Tic-tac-toe
A solved two-player game with a forced draw under optimal play.
Tic-tac-toe, known as noughts and crosses in Commonwealth English and Xs and Os in Canadian or Irish English, is a two-player paper-and-pencil game played on a three-by-three grid. Players alternate marking the nine spaces, one using X and the other O. A win is achieved by marking all three spaces of any row, column, or diagonal, traditionally indicated by drawing a line through those marks. The game is solved; with optimal play from both sides, it always ends in a draw. This simplicity makes it a common pedagogical tool for teaching sportsmanship and artificial intelligence concepts like game tree searching and the minimax algorithm. A computer program can easily play perfectly, and the game tree complexity, accounting for rotations and reflections, includes 26,830 possible games, with 765 essentially different positions. The game’s roots trace back to ancient Egypt around 1300 BC, where similar boards were found on roofing tiles. A Roman variation called terni lapilli, played with three pebbles per player that had to be moved, dates to the first century BC. The modern names are more recent: the first print reference to "noughts and crosses" appeared in 1858, while "tick-tack-toe" was recorded in 1884, though it originally described a different children’s game. The American renaming to "tic-tac-toe" occurred in the 20th century. In 1952, OXO, developed by Sandy Douglas for the EDSAC computer, became one of the first video games, playing perfect tic-tac-toe. In 1975, MIT students built a Tinkertoy computer that could play the game perfectly, now displayed at the Computer History Museum. With the internet, the game became a staple of casual digital entertainment, with Google integrating a playable version into its search results in 2016. Considering board symmetries, there are only 138 terminal positions: 91 won by X, 44 by O, and 3 drawn. The game can be generalized to an m,n,k-game, where tic-tac-toe is the 3,3,3 variant.
- also_known_as
- Noughts and crosses (Commonwealth English), Xs and Os (Canadian or Irish English)
- type
- Paper-and-pencil game
- players
- 2
Quick Facts
- Italic Title
- no
- Title
- Tic-tac-toe
- Other Names
- Noughts and Crosses / Xs and Os
- Genre
- Paper-and-pencil game
- Players
- 2
- Setup Time
- Minimal
- Playing Time
- ~1 minute
- Random Chance
- None
- Skills
- Strategy, tactics, observation
Facts from the source article.
Lore & Background
An early variation of tic-tac-toe, known as terni lapilli, was played in the Roman Empire around the first century BC. Unlike the modern version, each player had only three pieces and had to move them to empty spaces to continue playing. The game is played on a three-by-three grid by two players who take turns marking spaces, one with an X and the other with an O. A player wins by marking all three spaces of any row, column, or diagonal, traditionally drawing a line through those marks. The game is solved, meaning a forced draw results from optimal play by both sides. Its simplicity makes it a common pedagogical tool for teaching sportsmanship and artificial intelligence concepts like the minimax algorithm. The board’s incidence structure consists of nine points, three horizontal lines, three vertical lines, and two diagonal lines. The American name "tic-tac-toe" became standard in the 20th century, while Commonwealth English uses "noughts and crosses," referencing the shapes of the marks. The game can be generalized to an m,n,k-game, where players aim for k marks in a row on an m-by-n board. Tic-tac-toe is specifically the 3,3,3-game.
Reader's Guide
Tic-tac-toe is a solved game; when both players play optimally, the outcome is always a draw, rendering it a futile contest for perfect players. This simplicity makes it a common pedagogical tool for teaching sportsmanship and fundamental concepts in artificial intelligence, particularly the minimax algorithm and game tree searching. It is straightforward to program a computer to play perfectly or to enumerate the game's state space complexity of 765 essentially different positions and its game tree complexity of 26,830 possible games, accounting for rotations and reflections. The game's history stretches back to ancient Egypt, with game boards found on roofing tiles from around 1300 BC. A Roman variation called terni lapilli, played with three pieces per player that had to be moved, existed around the first century BC. The modern name "noughts and crosses" first appeared in print in 1858, while "tick-tack-toe" was recorded in 1884, though it referred to a different children's game. The American renaming to "tic-tac-toe" occurred in the 20th century. In 1952, OXO, developed for the EDSAC computer, became one of the first video games, featuring a perfect computer opponent. In 1975, MIT students built a Tinkertoy computer that could play the game perfectly, now displayed at the Computer History Museum. The game is a specific instance of the broader m,n,k-game, where it is the 3,3,3-game, and can be generalized further as an nd game or played on arbitrary incidence structures.
Did You Know?
- The game is a solved game, with a forced draw assuming best play from both players.
Frequently Asked Questions
Who is Tic-tac-toe?
Tic-tac-toe is a two-player paper-and-pencil game where opponents alternately claim cells on a 3×3 grid, trying to get three of their marks in a row. Depending on region it also goes by noughts and crosses (Commonwealth English) or Xs and Os (Canadian/Irish English).
What are Tic-tac-toe's powers/role?
Its defining trait is that it is a fully solved game: neither side can force a victory if both play optimally, so the outcome is always a draw. Because of that, it has become a staple teaching example in game theory and a classic benchmark problem in artificial-intelligence research.
How does Tic-tac-toe's story end?
Under best play from both players, every match resolves as a stalemate—no one can compel a win. That guaranteed draw is precisely what makes the game 'solved' in the mathematical sense.
More in Card & Tabletop Games 1-24
Spotted an error? Know more?
This is a living reference — every entry is fact-audited, and reader corrections feed straight into our audit queue. Suggest an edit · See this site's audit record
