/tic-tac-toe-python

Python based Tic Tac Toe game using MinMax Algorithm

Primary LanguagePythonMIT LicenseMIT

Tic Tac Toe - Python

License: MIT

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.

Contents

  1. tic_tac_toe.py

Usage

  1. tic_tac_toe.py contains all the essential code required to play tic_tac_toe game.

Prerequisites

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.

Running the game

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.

Playing the Game

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:

Playing the game

Feedback & Final Thoughts

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.

ForTheBadge built-with-love