Made by Potato GameDev on the Potato stream: https://www.twitch.tv/potatogamedev
This project is a simple implementation of the classic Tic-Tac-Toe game using Pygame, featuring an AI based on the MENACE (Machine Educable Noughts and Crosses Engine) algorithm. The AI can be trained through self-play to improve its performance over time.
If you are interested in doing some experiments with AI, maybe introducing your own algorithm that could beat mine, this project is a nice starter! Have fun!
To get started with the Poh-Tah-Toe game, follow these steps:
- Clone the repository:
git clone git@github.com:PotatoGameDev/poh-tah-toe.git cd poh-tah-toe
- Run the game:
python main.py
The game can be run in two modes: interactive and training.
To play against the MENACE-based AI interactively, simply run the game without any arguments:
python main.py
To train the AI by having it play against itself, use the --training or --training-games arguments:
Run 1000 AI vs AI games in headless (no UI) mode:
python main.py --training
Run a specific number of AI vs AI games in headless (no UI) mode:
bash
python main.py --training-games 500
If you want to start with clean slate, delete knowledge.json file in the main project dir.
Contributions are welcome! If you have any improvements or suggestions, please fork the repository and create a pull request. Here are some areas where you can contribute:
Enhancing the AI algorithm
Improving the game UI
Adding more features and functionalities
Fixing bugs and issues
Please make sure to follow the standard Git workflow:
Fork the repository
Create a new branch (git checkout -b feature-branch)
Commit your changes (git commit -m 'Add some feature')
Push to the branch (git push origin feature-branch)
Create a pull request