What this game is
Tic-tac-toe — noughts and crosses — is the best-known game ever played on squared paper, and for most of us the first game played against someone who could count further ahead.
Three by three, two marks, one goal: three in a row. The rules take ten seconds, which is exactly why the game became the classic teaching example: it is where people show how a machine looks ahead, what a game tree is, and what "solved" means.
The answer has been known for a long time: with perfect play on both sides tic-tac-toe is always a draw. You cannot beat the expert level — but you do not have to lose to it either. The question is whether you can hold the draw.
Rules
- The board is three by three. You play crosses (X, red), the computer plays noughts (O, blue).
- Players take turns; a move puts one mark in any empty square.
- Who moves first alternates: you open one game, the computer the next.
- The first to get three of his marks in a row — across, down or diagonally — wins. The winning line is marked in yellow.
- If all nine squares are filled with no three in a row, the game is a draw, and a draw is added to neither tally below the board.
How to play better
- The centre belongs to four of the eight lines, more than any other square. A corner belongs to three, an edge to just two.
- Moving first, open in a corner or the centre. A corner is the hardest to answer: the only safe reply to it is the centre.
- The real weapon is the fork: a move that makes two threats at once. One gets blocked; the second cannot be.
- Before building your own line, check whether the other side has two in a row with the third square empty. A missed block is the most common way to lose.
- Moving second, if the other side takes a corner, take the centre. An edge or the adjacent corner loses.
- Almost anything works against normal, a fork works against hard. Against expert there is one goal — not to slip: it picks the moves that leave you the most ways to lose.
A bit of history
Three-in-a-row games on a small board are very old; the familiar pencil-and-paper form and its names — tic-tac-toe in America, noughts and crosses in Britain — settled in the nineteenth century.
In 1952 Alexander Douglas wrote OXO at Cambridge for the EDSAC computer: a person played against the machine, and the board was shown on a small screen. It is often called one of the first computer games. In 1961 Donald Michie built MENACE, a "machine" that learned tic-tac-toe out of matchboxes filled with beads: after each game the beads for good moves were added to and the bad ones taken away. It is one of the earliest examples of reinforcement learning.
Searching the whole game is a beginner's programming exercise: there are 255,168 different games, and only 765 positions once rotations and reflections are set aside. The result is known: a draw. It is the smallest of the solved games in our reference of solved games, and its big sister is ultimate tic-tac-toe, nine boards in one.
About the levels
Normal notices only its own win: if it can put a third mark in a row, it does. Otherwise it plays anywhere and does not see your threats.
Hard also blocks your threats, and with a free move takes the centre, then the corners. A fork beats it: it cannot cover two threats at once.
Expert knows the value of every one of a few thousand positions and makes no mistakes. Among the moves that keep the best result, it picks the one that leaves you the most losing replies. It cannot be beaten; a draw against it is the best there is.