A swift
implementation of Tic-Tac-Toe.
The decision making process for the computer moves is taken care by a
straightforward MiniMax
(with and without Alpha-Beta Pruning
)
implementation.
You can also choose to let the computer pick a position at random, otherwise it will never loose 😃 .
To compile just use the provided Makefile by running the command:
make
on the terminal
./TicTacToe
For additional debug functionality you can run the program with one of the following parameters:
debug
fulldebug
For example:
./TicTacToe debug
The program will ask the player to pick his preferred symbol and will also let the player choose who plays first.
When the game gets going the player will be asked to input the row and column to place his symbol.
The coordinates are represented in the following format :
+++++++++++++++++++
| 0,0 | 0,1 | 0,2 |
+++++++++++++++++++
| 1,0 | 1,1 | 1,2 |
+++++++++++++++++++
| 2,0 | 2,1 | 2,2 |
+++++++++++++++++++