Tic-Tac-Toe

The classic game of strategy! Challenge an unbeatable AI or play with a friend. Can you win?

Next: X

0

X Wins

0

Draws

0

O Wins

How to Play

Game Modes

  • vs AI: Play against the computer. You are X and go first.
  • vs Friend: Two players take turns on the same device. X goes first.

AI Difficulty

  • Easy: The AI makes random moves 50% of the time.
  • Medium: The AI makes random moves 20% of the time.
  • Hard: Unbeatable! The AI uses the minimax algorithm - best you can do is draw.

Rules

  • Click any empty cell to place your mark (X or O)
  • Get three in a row horizontally, vertically, or diagonally to win
  • If all 9 cells are filled with no winner, the game is a draw
  • X is cyan/blue, O is rose/pink

Features

  • Score tracking persists during your session
  • Stats saved to your browser (X wins, O wins, draws)
  • Share your stats with friends
  • Smooth animations for X, O, and win lines

About Tic-Tac-Toe

Tic-Tac-Toe (also known as Noughts and Crosses or Xs and Os) is a classic paper-and-pencil game for two players. Despite its simple rules, the game offers interesting strategic depth, especially when playing against an opponent who knows optimal strategy.

Our implementation features an AI opponent that uses the minimax algorithm on Hard difficulty, making it impossible to beat when it plays perfectly. The best you can achieve is a draw. On Easy and Medium difficulties, the AI occasionally makes random moves, giving you a chance to win.

The game tracks your wins, losses, and draws across your session, and stats are saved to your browser. Whether you're practicing strategy against the AI or challenging a friend, Tic-Tac-Toe remains a timeless game of wits.