Tic Tac Toe AI


Date: January 2017 - February 2017

A simple Tic-Tac-Toe game created using JavaScript. The game offers two-player mode and a single player mode against an AI player with 3 different difficulties: Easy (random moves), Medium (some knowledge of the game) and impossible (unbeatable).


  • Interactive Tic-Tac-Toe game with Single-player and Two-player modes.
  • First experience with JavaScript.
  • Two-Player mode.
  • 3 AI difficulties: Easy, Medium and Impossible.
  • Easy AI - Randomly chooses a tile.
  • Medium AI - Moves to and blocks winning tiles, else moves randomly.
  • Impossible AI - Never loses against the human player, uses rule-based strategies.
  • End-game state detection.


Tic Tac Toe - Empty game
Tic Tac Toe - Draw against AI
Tic Tac Toe - Unfinished game