Tic-Tac-Toe is a simple game where two players compete to place three of their "pieces" in a straight or diagonal line. (Read More)
This Project turns Tic-Tac-Toe in to a fun, web-based game where players can try to defeat the Computer player. It is implemented using Django and HTML5.
Here are the steps to quickly get this game up and running on your system:
- Clone this repository
- Create a Virtual Environment for this project.
- Enter the Virtual Environment.
- Install the dependencies:
pip install -r requirements.txt
- Create the database:
python manage.py syncdb
- Start Django's built-in HTTP Server:
python manage.py runserver
- Open the game on your web browser by browsing to localhost:8000
The Artificial Intelligence is based upon the Perfect Strategy laid out in the Wikipedia article. It currently implements most of the strategy with the exception of the Fork and Block Forks steps. While there is room for improvement to increase the opportunity for the Computer player to win, my manual testing has shown that the game will always win in either a Draw or a Computer Victory.