A short history of Tic Tac Toe
Tic Tac Toe is one of the first games most people learn, and one of the first games computers learned too. Its full history is murkier than you might think.
Ancient three-in-a-row games
Games about getting three marks or pieces in a line are very old. Grids for three-in-a-row games have been found carved into stone in many places, including buildings from the Roman world. The Romans played a game often identified as terni lapilli ("three pebbles at a time").
It's tempting to call these the first Tic Tac Toe, and many articles do. The evidence suggests something a little different, though. In many of these older games each player had only three pieces and, once they were all on the board, moved them around to try to form a line. That's closer to the game known today as Three Men's Morris than to Tic Tac Toe, where marks are never moved. You'll also see claims that the game was played in ancient Egypt, but the evidence for those is thin.
What's safe to say: the idea of three in a row on a small grid is ancient and widespread, and pencil-and-paper Tic Tac Toe is one branch of that very old family.
Noughts, crosses and tick-tack-toe
The pencil-and-paper game as we know it was well established in Britain by the 19th century, under the name Noughts and Crosses: a nought is an O and a cross is an X. That's still its name in the UK and in many Commonwealth countries.
In North America, the name tic-tac-toe (also written tick-tack-toe) took over. Curiously, the name seems to have first belonged to a different children's game in which players brought a pencil down onto a slate with their eyes closed and scored according to the numbered area it hit. Over time the name moved to the noughts-and-crosses game.
Today the game has many names around the world. In Ireland it's often X's and O's, Spanish speakers may call it tres en raya ("three in a row"), and in Romania it's X și 0.
A game for the first thinking machines
Because it's small enough to analyse completely yet still feels like a real game, Tic Tac Toe has been tied to the history of computing from the start.
Charles Babbage, 19th century
The English mathematician Charles Babbage, who designed the Analytical Engine, wrote about building a machine that could play noughts and crosses. He hoped an exhibition of it might raise money for his larger projects. It was never built.
OXO, 1952
In 1952, at the University of Cambridge, Alexander (Sandy) Douglas wrote a noughts-and-crosses program called OXO for the EDSAC, one of the earliest stored-program computers. The board was displayed on a small screen, and the player entered moves with a rotary telephone dial. OXO is often listed among the very first video games, and the computer played a perfect game.
MENACE, 1961
The British researcher Donald Michie built a machine that learned to play noughts and crosses, made out of about 300 matchboxes filled with coloured beads. Each matchbox stood for a board position, and each colour for a move. After a win, beads for the moves played were added; after a loss, they were removed. Over many games the "machine" got better. MENACE (Matchbox Educable Noughts And Crosses Engine) is still used today to explain how machine learning works.
A computer made of Tinkertoys
In the late 1970s and early 1980s, a group of MIT students including Danny Hillis built a computer out of thousands of pieces of a children's construction toy. It played Tic Tac Toe and never lost. It's a memorable demonstration that a computer is defined by what it does, not what it's made of.
Tic Tac Toe in film
The game's most famous screen appearance is in the 1983 film WarGames. A military computer is about to start a nuclear war it treats as a game. It's stopped when it plays Tic Tac Toe against itself, discovers that every game ends in a draw, and concludes that the only winning move is not to play. It's a dramatic take on a real fact: perfect play always draws.
Why it lasts
Tic Tac Toe has survived for so long because it needs almost nothing: a few lines in the sand, on a napkin, on a fogged window, or on a phone. The rules take a minute to learn, and a game takes a minute to play. It's also many children's first strategy game, teaching turn-taking and planning ahead. You can read more about that in Tic Tac Toe for kids.
It also keeps growing. Players have invented bigger boards, three-dimensional versions, and games of Tic Tac Toe played inside Tic Tac Toe. See Tic Tac Toe variants for the best of them.