A classic Tic Tac Toe game requires two players to play. In this project, one of these players are an agent who learns to play through reinforcement learning method. Another player chooses random moves. Some methods are added to visualize the game as the players play and a graph shows the progress of the agent compared to the random player. Tkinter is used for this project o build the board and access it easily as it provides the grid functionality.
- Any Python supported IDE
- Python
- Tkinter
- Numpy, Random, Time, Matplotlib, IPython
- Install Python
- Install and import all(*) from Tkinter
- Install and import Numpy, IPython, Matplotlib
- Install and import any other libraries necessary
The tic-tac-toe file contains three classes for both of the agents and the game environment. After running the file, the game will proceed on its own as the agent and te random player keep playing. There will also be a graph to visualize the scores to the number of games played. The symbols are fixed for the players. The random player has the 'O' symbol and the agent has the 'X' symbol.
The grid doesn't completely show. The moves of the players appear with a border around them. The game doesn't shutdown with keyboard interrupt, the terminal needs to be deleted or killed. The starting player is always the agent.
- https://github.com/mudasiryounas/tic-tac-toe-game-reinforcement-learning
- https://github.com/Munfa/2048-python
- https://github.com/patrickloeber/snake-ai-pytorch
The gameboard
The graph; here, the blue line represents the agent and the orange line represents the random player
Scores after each game