This is a simple implementation of the classic game Tic Tac Toe in Python. You can play against another human or against an AI. AI is nothing but implementation of minimax algorithm.
This code is a modified version of the code which was coded by Gabriella, event instructor of [GHW Games Week] Building a Tic-Tac-Toe AI with Minimax Algorithm event.
You mark is 'X', and your friend's mark (or the AI's mark) is 'O'. Players have to enter number from 0-9 to place mark at that positon.
Number and mark position is as below:
0 | 1 | 2
3 | 4 | 5
6 | 7 | 8
- The game is played in the terminal
- You can choose to play against another human or against an AI
First clone this repository then
to run the game, navigate to the directory containing the main.py file in your terminal and run the command python main.py
. You will be asked to choose a game mode: 1 for Human vs Human, 2 for Human vs AI.
Pull requests are welcome.