Introduction: In this project I have created a tic-tac-toe learning bot using reinforcement learning. For details about about the project open Project.pptx file in this folder.
Instructions to run the code:
-
Open Anaconda (Terminal for Linux users) go to the directory in which the files are saved and enter the following line on the terminal:
python.exe Tic_tac_toe.py
-
Once you run that line the bot will start playing with another bot for about 50,000 games. This will take a few minutes. This is the learning process of the bot.
-
Once it is done playing 50,000 games. It will start playing with you. It will ask you if you want to go first or second. Enter either 1 or 2.
-
Start playing. You can enter the co-ordinates of the place where you want to place 'x' or 'o'. eg: If you are playing first, entering 1,1 will place it in the center of the board.
-
When the game is ended it will ask you if you want to play again? Enter 'y' if you want to play again else enter 'n'