A modern implementation of the classic Tic-Tac-Toe game with a web-based interface and AI opponent capabilities.
- Web-based user interface
- Player vs AI gameplay
- RESTful API backend
- Machine learning model for AI opponent
- Python 3.8 or higher
- pip (Python package installer)
- Clone the repository:
git clone <repository-url>
cd tic-tac-toe
- Install the required dependencies:
pip install -r requirements.txt
- Install the package in development mode:
pip install -e .
First, train the model:
python train_model.py
Then, start the game in development mode:
python run_dev.py
This will:
- Start the Flask backend server
- Automatically open your default web browser to http://localhost:5000
- You can then play the game through the web interface
To stop the server, press Ctrl+C
in the terminal.
tic-tac-toe/
├── backend/ # Flask backend server
├── frontend/ # Web interface files
├── models/ # AI model implementations
├── tests/ # Test suite
├── requirements.txt # Project dependencies
├── setup.py # Package setup configuration
├── run_dev.py # Development server launcher
└── train_model.py # AI model training script
The project uses several development tools:
ruff
for code lintingpre-commit
for git hooks- Flask for the backend server
- Flask-CORS for handling cross-origin requests
This project is licensed under the terms included in the LICENSE file.
- Fork the repository
- Create a new branch for your feature
- Make your changes
- Submit a pull request
If you encounter any issues or have questions, please file an issue in the project's issue tracker.