Game of the tic tac toe with different IAs to play with. This code was made just for fun and to give a start point for future implementations of new algorithms. The game has a graphic interface, a terminal one and a statistic one, they can be played with different board sizes (3x3,4x4..).
The code is done in Python 3.7 and the actual IAs implemented are Monte Carlo Tree Search a heuristic algorithm use in Alpha go, Q-Learning an reinforcement learning algorithm, Minimax, and a simple heuristic algorithm.
-Terminal interface:
- size: board size.
- trains_steps: train steps in each iteration (MCTS).
-Stadistic interace:
- Plot the score after x games between two agents.
-Graphic interface:
- size: board size.
- trains_steps: train steps in each iteration (MCTS).
- height: height of the interface.
- width: width of the interface.
python main.py size
To get a report of a qtable already train.
python check_qtable.py size
Types of games that can be play.
- Player vs Player
- Player vs IA
- IA vs Player
- IA vs IA
- IA vs IA stadistics
-MCTS: Monte Carlo Tree Search.
-MM: MiniMax, with "alpha beta optimization".
-Q-Learning: Reinforcement learning control.
-Heuristic
Dependecies need it to run the code.
pip install numpy
pip install pygame
pip install matplotlib
pip install pandas
pip install tqdm
pip install pylatex
The code use from other users of GiHub with some modifications.
- Monte Carlo Tree Search from int8.
- Graphic interface from nyergler.