Tic Tac Toe game implemented in Python using MinMax Algorithm. I have tried to comment the code as much as possible and is kept as simple as possible. The code makes use of MinMax Algorithm which is essentially a Recursive Algorithm. You can read more about the algorithm Here. Kudos to the author of the above site for explaining it very clearly.
- tic_tac_toe.py
tic_tac_toe.py
contains all the essential code required to play tic_tac_toe game.
This Project is intended to be used with Python 3.x
but feel free to convert it in order to use it for Python 2.x
. There is no special requirement for this project.
Use python tic_tac_toe.py
to run the code. Its a 2 player game with high difficulty level. So, All the best on defeating the AI.
The game is played on 3 X 3 grid with each grid numbered from 1 to 9, starting from top left corner.
Here's what it looks like when running the game:
Again, this project is intended for Education use. Feel free to use it. The code may not be very optimized, so if you tend to find any bug fixes, feature requests, pull requests, feedback, etc., are welcome... If you like this project, please do give it a star.