Tic-tac-toe

You0
Draws0
Computer0

Your move. You are X.

Whoever starts takes turns, game by game. Scores are kept separately for each level, in this browser only.

The three levels

Easy plays almost at random. It sometimes takes a winning square when one is open, and never blocks you on purpose.

Medium always completes a line when it can and usually blocks yours, but it cannot see a fork coming: a move that threatens two lines at once, so that it can only block one.

Hard searches every possible game from the current position and plays the best move. Played perfectly by both sides, tic-tac-toe always ends in a draw, so a perfect opponent cannot be beaten. This one is nearly perfect: in about one game in eight it makes a single weaker move, and only a win will tell you that you caught it.

Where to start

The centre square is part of four lines and each corner is part of three, while an edge square is part of only two. That is why strong players open in the centre or a corner, and why the fork, two threats at once, is the move that wins games.