Nepedia
Back to Discover
Advanced Reader
🎨

Tic-tac-toe

arts Maturity 7-9 Next article →

Tic-tac-toe is a classic paper-and-pencil game for two players.

Tic tac toe
Tic tac toe

In the United States, it is called "tic-tac-toe." In Commonwealth English, such as in Britain or Australia, it is known as "noughts and crosses." This name comes from the shapes used: a "nought" is a zero, shaped like an O, and a "cross" is an X. The game is defined by its simplicity and its mathematical depth. It is considered a "solved game." This means that if both players follow the best possible strategy, the game will always end in a draw. Because of this, it is often used to teach artificial intelligence and the concept of searching game trees.

To play, two players use a three-by-three grid containing nine spaces. One player is designated as X and the other as O. Players take turns placing their mark into an empty space. The goal is to be the first to align three of your marks in a row. This row can be horizontal, vertical, or diagonal. Traditionally, the winner draws a line through their three marks to celebrate. If all nine spaces are filled and no one has three in a row, the game is a draw. This result is sometimes called a "cat's game."

tic-tac-toe-game-1
tic-tac-toe-game-1

The mechanics of winning involve specific tactical moves. A player can win by completing a line of three. To prevent this, a player must "block" by placing their mark in the third space of an opponent's two-in-a-row. Advanced players look for a "fork." A fork is a move that creates two different ways to win at once. If a player creates a fork, the opponent can only block one path, allowing the first player to win on the next turn. Players must also learn to block an opponent's potential fork to stay in the game.

History shows that games involving three-in-a-row boards are very old.

Three Men's Morris variant board
Three Men's Morris variant board

In ancient Egypt, game boards were found on roofing tiles from around 1300 BC. Around the first century BC, the Roman Empire played a version called "terni lapilli." In that version, players used three pebbles instead of marks. They had to move their pebbles into empty spaces to keep playing. Chalk drawings of these grids have been found throughout Rome. Other ancient relatives include the game "three men's morris" and the Puebloan game "Picaria."

Tictactoe-X
Tictactoe-X

Tic-tac-toe has played a major role in the history of computing. In 1952, Sandy Douglas developed "OXO" for the EDSAC computer at the University of Cambridge. OXO is recognized as one of the first known video games. The computer could play a perfect game against a human. Later, in 1975, MIT students used a computer built from Tinkertoy elements to play the game. This Tinkertoy computer could also play perfectly and is now in the Computer History Museum.

Tictactoe-O
Tictactoe-O

Mathematics provides deep insight into the game's complexity. There are 765 essentially different positions in the state space. When including rotations and reflections, there are 26,830 possible games. A study of the game's combinatorics shows that if X always moves first, there are 91 distinct winning positions for X and 44 for O. Only 3 distinct positions result in a draw. When looking at the board symmetries, there are only 138 terminal board positions. These numbers show that while the game feels endless, it is mathematically limited.

Magicsquareexample
Magicsquareexample

The game can be expanded into much larger mathematical structures. It is a specific type of "m,n,k-game." In this generalization, players place stones on an m-by-n board to get k marks in a row. Tic-tac-toe is a 3,3,3-game. There is also "Harary's generalized tic-tac-toe," which expands the rules even further. Mathematicians can even view the game as an "incidence structure." In this view, the grid cells are points and the rows or diagonals are lines. This connects the simple game to much broader fields of geometry and logic.

672 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (6)
File:Tic tac toe.svg
Tic tac toe.svg
File:tic-tac-toe-game-1.svg
tic-tac-toe-game-1.svg
File:Three Men's Morris variant board.svg
Three Men's Morris variant board.svg
File:Tictactoe-X.svg
Tictactoe-X.svg
File:Tictactoe-O.svg
Tictactoe-O.svg
File:Magicsquareexample.svg
Magicsquareexample.svg
More to explore

🔬 Go deeper

More advanced topics to explore

🪜 Step back

Simpler topics to build understanding

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.