This is the code repository for my article on Medium - Playing Games with Python - Tic Tac Toe, where I have tried to take the famous Tic-Tac-Toe game and create a bot proficient enough to beat human players, if not the game itself.
- A fully playable Tic-Tac-Toe environment.
- A bot trained using Temporal Difference learning (A technique in Reinforcement learning).
- A bot trained using the Minimax Algorithm.
run python testing_(HumanvsAI)_ReinforcementLearning.py
run python HumanvsAI_Minimax.py
run python HumanvsHuman.py
Out of the two implementations, only the RL bot needs to train in order to reach proficiency. It does so by play 1v1 with another RL bot sharing the same state values in order to learn to beat itself and eventually become better. The num_iterations
parameter controls the number of games that will be played among the bots.
run python training_(AIvsAI)_ReinforcementLearning.py
I wrote anotherr script in order to see which bot performed better in very brutal 1v1 fashion. The num_iterations
parameter controls the number of games that will be played among both the bots.
run python Showdown_Minimax_vs_RL.py
- Minimax Algorithm
- Temporal Difference Learning
- Q Learning
- Genetic Algorithms