The famous TicTacToe and Connect4 games that can be played against an AI that plays using the Minimax algorithm strategy.
No additional packages are needed. Just run the command:
python TicTacToe.py
Below is a sample output
D:\MinMax-Python-Games>python TicTacToe.py
0 0 0
0 0 0
0 0 0
Player 1 turn:
Enter x:1
Enter y:1
0 0 0
0 1 0
0 0 0
Player 2 turn:
(0, 0)
2 0 0
0 1 0
0 0 0
Player 1 turn:
Enter x:
As you can see, input is required only for the first player, since the second player input is calculated by the AI.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.