How to win at tic-tac-toe, and never lose
Strategy · · 4 min read
Tic-tac-toe is the first strategy game most people learn, and one of the few that has been completely solved: if neither player makes a mistake, every game ends in a draw. That sounds like the end of the story. It is not, because people make mistakes all the time.
So the real game has two halves. The first is never losing, which takes a handful of rules. The second is winning, which means steering the game toward positions where one careless move is fatal for the other player.
The board in numbers
There are eight ways to make three in a row: three rows, three columns and two diagonals. The nine squares are not equal:
- The centre is on four of those lines — both diagonals, the middle row and the middle column.
- Each corner is on three: a row, a column and a diagonal.
- Each edge square is on only two.
Every move, in order
A good move comes from checking a short list, top to bottom, and taking the first thing that applies. It is the list Allen Newell and Herbert Simon gave their tic-tac-toe program in 1972, and it never loses:
- Win: if you have two in a line and the third square is free, take it.
- Block: if your opponent has two in a line, take the third square.
- Fork: make a move that creates two threats at once.
- Block their fork: if they could fork on their next move, take that square — or make a threat of your own that they have to answer.
- Centre: take it if it is free.
- Opposite corner: if they hold a corner, take the one across from it.
- Any free corner.
- Any free edge square.
The fork
The fork is the only way to beat a player who always blocks. With one move you make two lines that each need just one more square. Your opponent can block one of them; you complete the other.
Forks come from corners, because each corner sits on three lines. Two corners with the centre, or three corners, are the shapes to aim for — and the shapes to stop your opponent from building.
Playing X: start in a corner
X moves first and has the edge. The centre is a strong opening, but a corner sets more traps: against a corner, the only reply that does not lose is the centre. On any other square, X can force a fork.
If O does take the centre, X can take the opposite corner and wait. That position hides the most common mistake in the game.
Playing O: the safe answers
O moves second, so the first job is not to lose. The right reply depends on where X opened:
- X opens in a corner: take the centre. Nothing else holds.
- X opens in the centre: take a corner. An edge square loses against correct play.
- X opens on an edge: the centre is the safe reply.
The trap to avoid
X takes a corner, O takes the centre, and X takes the opposite corner. Now it feels natural for O to take another corner. That loses: X has to block O’s diagonal, and the square that blocks it also makes a fork.
The answer is an edge square. It makes a threat X has to block, and the game heads for a draw.
How to win against real people
A perfect player cannot be beaten, so the aim is to give an imperfect one the chance to go wrong:
- As X, open in a corner. It leaves O exactly one safe reply, and plenty of players get it wrong.
- Make threats that force a block. A forced reply is a move your opponent did not choose, and it can pull them away from where your fork is coming.
- Before every move, look for their fork as well as your own. Most lost games are lost to a fork the loser did not see coming.
- As O, play the safe answers every time. A draw costs you nothing; a loss does.
Tic-tac-toe on Duelto
On Duelto, tic-tac-toe is played one on one against a real opponent, matched in seconds or challenged by username. Every win and loss moves a rating of its own, and a draw leaves both ratings where they were. There is a bot for practice too: it plays well but not perfectly, so the fork you just learned can beat it.
When three in a row stops being a challenge, RPS Board is the next step: hidden pieces on a bigger board, where you cannot see everything you need to know.