The Game

There are three game modes:

Note: there is no use of AI in this project. The solution is hard-coded, but saying "AI" looked better nowadays!

Easy AI

Easy AI is built so that your computer will pick a random move without any algorithm behind. Thus, it will be beatable most of the times.

Impossible AI

Impossible AI (it should really be impossible to beat!) is built using a hard coded solution that explores in order of priority the next best move. The logic of this mode was solely thought by the author of this project, Riccardo Bean.

How Impossible AI works

If you want to play the game, don't look at it! (You won't be able to win anyways though!)

In order of priority, the AI will (if possible):

  1. Win vertically
  2. Win horizontally
  3. Win obliquely
  4. Block vertically
  5. Block horizontally
  6. Block obliquely
  7. Play in the center
  8. Create a fork
  9. Play in a corner
  10. Do a random move

If you happen to beat impossible AI, please take a screenshot of how you cheated and submit it (along with a brief explanation) using the button below.