Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 1.36 KB

README.md

File metadata and controls

30 lines (21 loc) · 1.36 KB

Update:

Thank You to All Who Participated!

It took around 188 games against humans to make the AI virtually unbeatable. It would usually take around 10,000 games against another AI trainer for the AI to get sub-par. The memories are now updated in realtime ;).

Here is the memory.txt file for the global AI

Check out a working online version in the link below:

Compete against the global AI here

Tic Tac Toe Learner

An AI that learns how to play tic tac toe using a simple machine learning algorithm.

How it works

The AI stores every move that has been made and the move's value in a text file. For every turn, the AI makes a decision by looking at all the next possible moves and choosing the one with the highest value. When the game ends, if the AI wins, the values of all the moves that have been made will be incremented, and similarly, if the AI loses, the values of all the moves that have been made will be decremented.

Required External Packages

  • Pygame 1.9.3

Instructions

  1. Install external packages
  2. Run ttt_gui.py in Python 3
  3. Play against the AI

Get a strong AI

If you want to start the AI out strong, copy and paste this memory file into the project directory. The AI will automatically load it in on start. Enjoy!