Retro board game strategy

The History of Tic Tac Toe: From Ancient Egypt to AI

Published on June 26, 2026 • By Alex Carter, Game Developer

Few games are as universal or instantly recognizable as Tic Tac Toe. Played on playgrounds, scratched on paper during school lessons, and coded by programmers learning their first variables, the 3x3 grid is a staple of global culture. Yet behind its apparent simplicity lies a deep history spanning thousands of years, migrating across empires, and serving as a foundational benchmark for artificial intelligence. Far from being a modern children's time-waster, Tic Tac Toe is a historical artifact that connects ancient builders to modern software engineering.

1. The Ancient Roots: Carvings in Egyptian Stone

To trace the beginnings of Tic Tac Toe, we must look back over three millennia. In the late 19th and early 20th centuries, archaeologists conducting excavations in Egypt discovered three-in-a-row grids carved into the roofing tiles of temples in Kurna, dating back to approximately 1300 BCE. While we do not have written rulebooks from the New Kingdom of Egypt, historians believe these grids were used for alignment games similar to modern Three Men's Morris or Tic Tac Toe. In these early versions, players did not merely mark spaces with writing implements; instead, they placed physical tokens—such as stones, pebbles, or carved bones—on the grid lines, taking turns to slide them into winning alignments.

Similar boards have been found in ancient sites across Greece and Rome. The Romans played a popular three-in-a-row variant known as Terni Lapilli (which translates to "three pebbles at a time"). The grids for Terni Lapilli are found scratched into public buildings, steps, and Roman baths throughout the empire, from Italy to Great Britain. Unlike modern Tic Tac Toe, where the board is filled and the game ends, players in Terni Lapilli only had three pebbles each. Once all six stones were placed, players would slide them to adjacent empty spots on the grid. This dynamic sliding rule prevented the constant draws that characterize the modern version, making Terni Lapilli a game of high mobility and quick tactical adjustments.

2. Evolution of the Name: From Noughts and Crosses to Tic Tac Toe

As the centuries progressed, the game evolved and adapted to different cultures. In the English-speaking world, the game was historically known as "Noughts and Crosses," a descriptive term referencing the circular 'nought' (O) and the intersecting 'cross' (X) used by the players. This name remains the primary designation in Great Britain, Australia, and New Zealand. The first print reference to "Noughts and Crosses" appeared in the British journal Notes and Queries in 1864, where it was described as a traditional game played on slates by children.

How did the name "Tic Tac Toe" come to dominate North America? The phrase itself has roots in the 19th century. In England, "tick-tack-toe" (or "tit-tat-toe") originally referred to a slate game where players closed their eyes and brought a pencil down onto a numbered slate, scoring points based on where the pencil landed. The rhythmic name mimics the sound of the pencil striking the slate: "tick" for the first tap, "tac" for the second, and "toe" for the final strike. During the late 19th and early 20th centuries, American school children and game publishers adapted this catchy, onomatopoeic name and applied it to the classic grid game of Noughts and Crosses. By the 1920s, "Tic-Tac-Toe" had become the standard name across the United States and Canada.

3. OXO: The Digital Dawn of Browser Gaming

In 1952, Tic Tac Toe transitioned from slates and paper to silicon, playing a pivotal role in the birth of computer science. Alexander S. Douglas, a PhD candidate at the University of Cambridge, was writing a thesis on human-computer interaction. To demonstrate his theories, he wrote a software program named OXO for the EDSAC (Electronic Delay Storage Automatic Calculator), one of the world's first stored-program computers. The computer screen was a cathode-ray tube that displayed the grid and the players' moves in real-time. The player would input their move using a rotary telephone dial, and the EDSAC would compute its countermove. OXO is recognized as one of the first-ever graphical computer games in history. Although it was only playable in a laboratory setting, it proved that computers could simulate complex, logic-based human activities, laying the conceptual groundwork for the video game industry.

4. The Mathematics of Tic Tac Toe: A Solved Game

From a mathematical standpoint, Tic Tac Toe is classified as a two-player, zero-sum game of perfect information. "Zero-sum" means that one player's gain is exactly equal to the other's loss, and "perfect information" means that both players have complete visibility of the board state at all times; there are no hidden cards or elements of luck. Because the board is small, consisting of only nine cells, the state space is remarkably small. There are 255,168 unique possible games that can be played, and only 138 terminal board layouts when symmetries and rotations are accounted for. Because of this limited space, Tic Tac Toe is a "solved game." If both players play with perfect strategy, the game will always end in a draw. The strategy is so straightforward that it can be summarized in a simple hierarchy of choices:

  • Win: If you have two in a row, place the third to win.
  • Block: If the opponent has two in a row, place your mark to block them.
  • Fork: Create an opportunity where you have two threats to win.
  • Block Fork: Prevent the opponent from creating a fork.
  • Center: Take the center square.
  • Opposite Corner: If the opponent is in a corner, play the opposite corner.
  • Empty Corner: Play in an empty corner.
  • Empty Side: Play on an empty side square.

5. Artificial Intelligence and the Minimax Algorithm

Because Tic Tac Toe is a solved game with a small state space, it serves as the perfect introductory project for teaching artificial intelligence. The primary algorithm used to program unbeatable Tic Tac Toe computers is the minimax algorithm. Minimax is a recursive decision-making algorithm that evaluates all possible future states of the board. The computer calculates the game tree to its terminal nodes, assigning scores to wins (+10), losses (-10), and draws (0). It then bubbles these scores up the tree. The player (maximizing player) tries to get the highest score, while the computer (minimizing player) chooses moves to minimize the player's score. On modern web browsers, the minimax algorithm can compute all possibilities in less than a millisecond, which is why the "Hard" difficulty on our Tic Tac Toe game is mathematically impossible to beat. By studying this simple algorithm, computer scientists have developed the core systems that now power chess computers, optimization models, and complex logistics networks.

Conclusion: The Open Web Console

Today, Tic Tac Toe has completed its long journey from ancient Egyptian temple roofs, through Roman bathhouses, to the digital realm of HTML5. By rendering instantly on modern web browsers, it remains just as accessible as it was when written on slate tiles. It serves as a reminder that the best game designs are those that require no instructions, yet provide a perfect playground for testing both human intelligence and advanced computational logic.

References & Sources:
  • Douglas, A. S. (1952). OXO and Human-Computer Interaction. University of Cambridge Computer Laboratory.
  • Bell, R. C. (1979). Board and Table Games from Many Civilizations. Dover Publications.
  • Russell, S., & Norvig, P. (2020). Artificial Intelligence: A Modern Approach. Pearson.

Test your strategy!

Think you can beat the minimax algorithm? Head over to our free online Tic Tac Toe game and test your skills against the computer right now!