/AIFriendly-tictactoe

AI-Friendly learns to play tic-tac-toe

Primary LanguagePython

AIFriendly-ticktacktoe

AI-Friendly plays tic-tac-toe


In a Nutshell


STEP 1: BUILD

bash build.sh

To build the models yourself please run

  • Building takes 5 minutes
  • 2 information graphs are shown and script resumes after manually closing them
  • Uses python3 and specifically Keras (pip install keras)
  • Ends with a direct match between you and AIFriendly

STEP 2: PLAY

To play against AI-Friendly after building run

bash play-first.sh

If you want to be the "X", or

bash play-second.sh

If you want to be the "O"
Finally: if you want to make it more intelligent then run

bash enhace.sh

(it can be enhaced as many times as you want, suggested: start with one)

If you want to play against the 'enhaced AI' then you must add the flag 'enhace' to the playing scripts e.g.

bash play-second.sh enhace

More Info:

1) How did AI-Friendly learned to play Tic-Tac-Toe?

AI-Friendly was able to learn how to play Tic-Tac-Toe by finding patterns in a tic-tac-toe database.

2) Does this problem differs from other problems that AI-Friendly solved?

Yes, the present task stands out in the context of it being what is called 'pattern recognition'

3) What are the main differences between pattern-recognition tasks and pure-classification tasks?

In pure-classification tasks the objects tend to be uniquely defined: a chair is 100% a chair and a cat is 100% a cat; wether in this problem which involves pattern-recognition one same move in the training database may be sometimes tagged as "a good move" and other times as "a bad move".

4) How was the database generated?

A training database was generated by defining a class with an attribute that makes a random move, instantiating two of such objects and finally making them both play against each other. The result was a collection of ~ 10k tic-tac-toe games

5) Training with the randomly-generated database leads to an insatisfactory amount of intelligence. What can I do?

You can re-train it against itself and thus make it smarter by running
bash enhace.sh