Skip to content

Reinforcement learning and other approaches to the classic game of Tic-Tac-Toe.

Notifications You must be signed in to change notification settings

nazianafis/Tic-Tac-Toes

Repository files navigation


header

Tic-Tac-Toe

Tic-Tac-Toe is a two player game where each player takes turns marking the spaces in a 3x3 grid with either of the two distinct symbols (Xs and Os). The player who succeeds in placing three of their marks in a horizontal, vertical, or diagonal row is the winner.




In this repository, I've implemented the game of Tic-Tac-Toe via multiple approaches.


S.no. APPROACH CODE
1. MinMax, CLI Link
2. GUI, two player Link, Demo
3. Reinforcement Learning, CLI Link
4. Reinforcement Learning, GUI Link, Demo


To run the GUI version of Tic-Tac-Toe program with Reinforcement Learning:

  1. Clone the repository and move to the downloaded folder:
    $  git clone https://github.com/nazianafis/Tic-Tac-Toes
    $  cd Tic-Tac-Toes
  1. Run ttt_gui_rl.py:
    $ python ttt_gui_rl.py
  1. Wait for the agent to train and its policy to save and load.

  2. The PyGame window will open up. Enjoy the gameplay!



Acknowledgements

About

Reinforcement learning and other approaches to the classic game of Tic-Tac-Toe.

Topics

Resources

Stars

Watchers

Forks