Solving TicTacToe with QLearning Demo

This is a simple game that are easy to learn by humans but for experimental reason we want to solve it using qlearn, what would be the optimal moves given that there are 2 players

1.) Mapping O and X states

Again, there may too many states to cover, so we will do is get the difference of height percentage of the bird and the two pipes:

2.) Adding states scenarios as inputs (even if its incomplete that's ok, as long as we achieve a goal)

Syntax: state action reward next-state

Results: (Note: Press compute policy button multiple times until it gets the optimal policy)

Per Action:

Now let's try to beat this AI, press the compute policy couple of times first to train the AI.

Click on the panels to start

Conclusion: Now we know that our algorithm can create a tough AI that's impossible to beat, although training for a simple game requires a lot of states.

Applying a shortcut algorithm using approximation for tictactoe