Home / Games / Classics / Tic-Tac-Toe

Tic-Tac-Toe

Score: 0Best: 0

Tap a square to place your X. Switch between 3×3 and 4×4 boards from the end-of-game screen.

A tic-tac-toe board is small enough that a computer can search every possible continuation, which is what the AI here does: full minimax with alpha-beta pruning. On the 3×3 board it cannot be beaten, so a draw is a win. The 4×4 board with three-in-a-row has far more branching, which gives human players an actual chance — and a much more interesting game.

How to play Tic-Tac-Toe

  1. Tap an empty square to place your X. The AI plays O and answers immediately.
  2. Three in a row — across, down or diagonally — wins on the 3×3 board. The 4×4 board also needs only three.
  3. If every square is full with no line, the game is a draw.
  4. From the result screen you can restart or switch board size.

Strategy tips

On 3×3 the only way to survive is to take the centre or a corner first and then always answer a fork. If you can create two threats at once, the AI can only block one. On 4×4, the corners are much less valuable than the two-by-two centre squares: a centre block of four stones contains two lines at once, so it generates forks almost for free.

Why play it here

Two board sizes in one page, instant restart, and a running record of wins, losses and draws saved on your device. No pop-ups and no waiting for another player.

More classics games

Questions

Is the AI really unbeatable?

On the classic 3×3 board, yes — it searches the full game tree with minimax and alpha-beta pruning, so it never makes a losing move. The 4×4 mode is much larger and the AI plays a very strong game rather than a mathematically perfect one.

What is a fork in tic-tac-toe?

A fork is a move that creates two simultaneous winning threats. The opponent can only block one, so a fork wins on the following move. It is the main way to beat a defensive player.

Which first move is best?

On 3×3 a corner is the strongest opening because it creates the most forks later. The centre is safest for a draw. On the 4×4 board, opening in the central two-by-two area is clearly best.

Can two people play on one phone?

This version is single-player against the AI. Because it is tap-based, you can still pass the phone between two people and let the second player use the AI's moves as a reference.