This is the Tic-Tac-Toe game made with Python using the PyGame library and the Gym library to implement the AI. In this game you could play against the AI that I have created using the Gym libray and StableBaselines3
Little overview
Python 3.7 required
_(I hardly recommend the conda enviroment in order to run all the files)_
Use the package manager conda to install the same virtual environment that I used, this command will create a new virtual environment with the same libraries that I used:
The my_enviroment.yml is in this repo
conda env create -f my_environment.yml
Then to execute the app to:
python tictactoe.py
In this repo you can find the following file:
- tictactoe.py: the main file made with Pygame that you need to execute it in order to play the game
- Tic_Tac_Toe_Gym.ipynb: the file that creates the IA for the oponent. You can execute this in Google Colab if you want
- model5millonesFinal.zip: the file that I import in tictactoe.py file; in this file is where I saved the AI
The AI for this game was created using Reinforcement Learning using the Gym Library and StableBaselines3. For this AI I specified all the tic-tac-toe rules and the model itself learnt the rules, after 5 millions steps.