doodletictactoe
A hand-drawn noughts and crosses grid in pencil on squared paper, with a few Xs and Os and a pencil resting beside it on a wooden table
AI-generated image, not a photograph of a real person or place.

THE MATHS OF A PLAYGROUND GAME

Nine squares,
no winner.

Play noughts and crosses perfectly and it always ends in a draw.

The game has been fully worked out by mathematicians. There are 255,168 ways a game can unfold, a short list of rules that never loses, and a Cambridge computer that played it back in 1952.

DRAW with perfect play

Pick your next move

THE SHORT ANSWER

Small board,
big tree.

Nine squares and eight winning lines.
Every possible game has been counted.

THE MATHS

A solved draw

With best play from both sides neither player can force a win, so the game is a theoretical draw. Mathematicians call it a solved game.

See the numbers

STRATEGY

A rule list that never loses

A 1972 priority list by Newell and Simon tells you what to do each turn: win, block, fork, block a fork, then centre and corners.

Try the rules

HISTORY

An early computer game

In 1952 a Cambridge PhD candidate wrote OXO, noughts and crosses for the EDSAC computer, with moves picked on a telephone dial.

Meet OXO
A close view of an old valve computer rack with rows of glass valves and a small round cathode-ray tube display in a museum gallery
AI-generated image, not a photograph of a real person or place.

FOUR HABITS TO TRY

Never lose
again.

You cannot force a win against someone who plays perfectly, but you can make sure you never lose, and pounce when they slip.

  1. Scan for your own win first

    Before anything else, check every line for two of your marks and an empty square.

  2. Then look for their threat

    If they have two in a line, block it straight away. A missed block is the usual way games are lost.

  3. Set up a fork

    Aim for a move that makes two lines of two at once. Your opponent can only stop one of them.

  4. Know any opening is safe

    X can win or force a draw from a corner, edge or centre start. A corner leaves the opponent the fewest safe replies.

TWO NUMBERS WORTH KNOWING

Lots of games,
very few endings.

One figure counts every possible game,
one counts the different ways it can end.

255,168

Possible games of noughts and crosses

Counting every order of moves, without merging mirror images, there are 255,168 games. Of these, 131,184 are won by the first player, 77,904 by the second and 46,080 are draws.

EVERY GAME · GAME TREE

138 endings

Different finished boards

Treat rotations and reflections as the same and there are 138 finished boards: 91 won by X, 44 won by O and only 3 drawn.

ENDINGS · UP TO SYMMETRY

The first player wins far more of the random-play games, yet with perfect play from both sides the result is always a draw. A second player cannot have a winning strategy, because an extra mark on the board can never hurt the first player.

WHAT SHOULD I DO NOW?

Pick the situation,
get the move.

Perfect play follows a strict order of priorities. Choose what you see on the board to find the move, and how high it sits on the list.

Move finder

What is on the board?
I have two in a lineWin

Top priority. If one of your lines has two of your marks and an empty square, play there and the game is yours.

They have two in a lineBlock

Second priority. If your opponent has two in a line with a gap, fill the gap or they win next turn.

I can make two threatsFork

Third priority. A fork creates two lines that each need just one more mark. Your opponent can only block one.

Nothing urgent, centre emptyCentre

After wins, blocks and forks are dealt with, the list says take the centre square if it is free.

Nothing urgent, centre takenCorner

Lower down the list: take the corner opposite your opponent's, then any empty corner, and only then an edge square.

Source: the priority order (win, block, fork, block a fork, centre, opposite corner, empty corner, empty side) from Newell and Simon (1972), as listed in the Wikipedia article on tic-tac-toe.

Based on the Newell and Simon (1972) strategy as summarised in the Wikipedia article on tic-tac-toe.

Two hands playing noughts and crosses in chalk on a small blackboard, one hand about to draw an X in a corner square
AI-generated image, not a photograph of a real person or place.

OXO, 1952

The computer
that played back.

Alexander Douglas was a PhD candidate at the University of Cambridge when he wrote OXO for the EDSAC computer. It showed the board on a cathode-ray tube driven as a 35 by 16 dot grid, and players chose a square with a mechanical telephone dial.

The player decided who went first by dialling 0 or 1. It was made to support his dissertation on human-computer interaction, and few people outside Cambridge ever played it.

Questions

Questions people ask

Can you always win at noughts and crosses?

No. If both players play perfectly, neither can force a win and the game ends in a draw. You can only win if your opponent makes a mistake.

How many different games are there?

Counting every order of moves, there are 255,168 possible games. If you treat rotations and reflections as the same, there are 26,830 games and 765 essentially different positions.

Is it better to start in the centre or a corner?

X can win or force a draw from any opening. A corner leaves the opponent the fewest replies that avoid losing; one study cited on Wikipedia suggests the centre may be best against imperfect players.

What about bigger versions?

They behave differently. On a 3×3×3 cube the first player can force a win, in as few as four moves, starting in the central cube. The 4×4×4 game Qubic was proved a first-player win in 1980 using over 1,500 hours of computer time.

How old is the game?

Three-in-a-row boards have been traced to roofing tiles from around 1300 BC in ancient Egypt, and a Roman version called terni lapilli was played around the first century BC.

Sources

  1. Norman Do, How to win at tic-tac-toe, Gazette of the Australian Mathematical Society (2005)
  2. Jesper Juul: 255,168 ways of playing tic tac toe
  3. Wikipedia: Tic-tac-toe
  4. Computer History Museum: Timeline of computer history, 1952
  5. PONG-Story: Noughts and Crosses, the oldest graphical computer game

Updated

ABOUT THIS NAME

Interested in leasing doodletictactoe.com?

doodletictactoe.com is part of the DoodleSale portfolio. It isn't in an auction right now, but you can ask about leasing it.

Ask about this name