Skip to content

Latest commit

 

History

History
55 lines (44 loc) · 1.26 KB

README.md

File metadata and controls

55 lines (44 loc) · 1.26 KB

ttt

An implementation of tic-tac-toe in C, featuring an AI powered by the negamax algorithm.

This program operates entirely in the terminal environment. Below is its appearance as it awaits your next move:

 1 |  ×
 2 |     ○
 3 |
---+----------
      A  B  C
>

To execute a move, enter [column][row]. For example:

> a3

Press Ctrl-C to exit.

Game Rules

The winner is determined by the first player who successfully places three of their marks in a row, whether it be vertically, horizontally, or diagonally, regardless of the board size.

For this two 4x4 board games as examples,

 1 |  ×  ×
 2 |     ○  ×
 3 |     ○
 4 |     ○
---+------------
      A  B  C  D
>

The palyer "○" wins the game since he placed his marks in a row vertically (B2-B3-B4).

 1 |  ×  ×  ○
 2 |  ×  ○  
 3 |  ○  
 4 |     
---+------------
      A  B  C  D
>

The palyer "○" wins the game since he placed his marks in a row diagonally (A3-B2-B1).

Reference