How Tic Tac Toe Became One of the First Games Computers Learned to Play

In 1952, a doctoral student at Cambridge named Alexander Douglas built something nobody had built before: a computer that could play a game against a human, displayed on a screen you could actually watch. The game was tic tac toe. The machine was the EDSAC. And what Douglas created, almost as a side note to his thesis on human-computer interaction, would later be recognized as the first graphical computer game in history. That is not a minor footnote. It is the opening sentence of an entire field.

Key Takeaways:

- Alexander Douglas's 1952 OXO program is widely cited as the first graphical computer game ever made

- Tic tac toe was chosen because its perfect-play solution is mathematically provable, making it ideal for early AI demonstration

- The minimax algorithm powering optimal play could run on machines with almost no working memory

- Early AI researchers used tic tac toe as a benchmark problem long before chess became the dominant test

- The same strategic logic that ran on EDSAC cathode-ray tubes now runs directly in your browser

A Doctoral Thesis That Accidentally Made History

Douglas called his program OXO, which is the British name for what Americans call tic tac toe. The board was displayed on a cathode-ray tube, a modified oscilloscope that formed part of the EDSAC computer at the University of Cambridge. Players made their moves using a rotary telephone dial. Each position on the dial corresponded to one of the nine squares on the grid.

The whole project existed to support a thesis argument, not to entertain anyone. Douglas was trying to demonstrate that a computer could interact with a human in a meaningful, real-time way on a visual display. Tic tac toe gave him the cleanest possible vehicle for that argument. The game was simple enough to implement on constrained hardware, visual enough to show on a screen, and structured enough to prove the machine was making genuine decisions.

OXO's documented history confirms it was never commercialized or distributed. It ran on one machine, in one lab, for a small number of observers. But the record of its existence was preserved, and that record was enough to place it at the very beginning of a lineage that now encompasses every video game ever made.

Why Tic Tac Toe Was the Right Problem for Early Machines

You might reasonably ask why researchers kept returning to tic tac toe specifically during the early decades of computing. The answer is almost entirely mathematical, and it comes down to two properties the game has that most games do not.

The first property is a finite, completely mappable game tree. Every possible sequence of moves in tic tac toe can be enumerated. There are 255,168 possible games if you trace every variation from the opening move to the last, but once you account for rotational and reflective symmetry, the number of truly distinct positions collapses to a much smaller set. This made the game feasible for machines that operated on a few hundred words of memory rather than the gigabytes we take for granted today.

The second property is even more important: tic tac toe has a provably optimal strategy, and that strategy is verifiable. If both players make perfect decisions at every turn, every single game ends in a draw. This is not a statistical tendency or a probability. It is a mathematical certainty. A researcher could program a machine to play optimally and then confirm the machine was actually doing so, because the correct behavior at every position is known in advance. That verifiability mattered enormously at a time when people were still trying to establish what "intelligent" machine behavior even meant.

Minimax Logic on Minimal Hardware

The algorithm that enables perfect tic tac toe play is called minimax. The intuition behind it is straightforward even though tracing through the full tree takes patience. The algorithm works by imagining all possible futures from any given board position and selecting the move that produces the best outcome assuming the opponent also plays perfectly.

A minimax search for tic tac toe proceeds roughly like this:

  1. Look at the current board and generate every legal move.
  2. For each candidate move, generate every legal response the opponent could make.
  3. For each of those responses, generate every possible reply, and keep extending the tree until positions where the game ends.
  4. Assign numerical values to terminal positions: a win is positive, a loss is negative, a draw is neutral.
  5. Work backwards up the tree, selecting the highest-value move at each step you control and the lowest-value move at each step the opponent controls.
  6. Return the move at the top of the tree that produces the best guaranteed outcome.

On EDSAC, which had roughly 512 words of working memory, this kind of computation required careful implementation. The small game tree of tic tac toe made it achievable. Chess, by contrast, branches so aggressively that the total number of possible games vastly exceeds the number of atoms in the observable universe. No hardware of that era could search a chess game tree meaningfully, which is exactly why tic tac toe served as the benchmark first, and chess came much later once processing power caught up.

The Research Benchmark That Outlived the Hardware

After Douglas completed his thesis, the EDSAC was eventually retired and the physical apparatus that ran OXO ceased to exist in working form. But the ideas it demonstrated spread through the academic literature with remarkable speed. Researchers in the 1950s and 1960s who were building the foundations of artificial intelligence cited the tic tac toe problem explicitly as a starting point for thinking about game-playing machines.

The minimax algorithm grew more sophisticated over the following decades. Researchers added alpha-beta pruning, a technique that eliminates branches of the game tree that cannot possibly affect the final decision, cutting down the search space significantly without changing the result. This optimization eventually made chess-playing programs viable, and the same core logic that Douglas demonstrated on a nine-square grid powered Deep Blue when it defeated Garry Kasparov in 1997.

The line of influence is genuinely traceable. A provably solvable three-by-three grid in a Cambridge lab in 1952 contributed directly to the architecture of every serious game-playing program that followed.

The Pedagogical Life of a Solved Game

Beyond research, tic tac toe found a second and equally important life as a teaching tool. Computer science instructors realized that the game offered something rare: a problem that was complex enough to teach real concepts but small enough that a student could verify their own work by hand.

Generations of students wrote their first AI programs as tic tac toe bots. The project was short enough to complete in a week, self-contained enough to debug without losing track of the whole system, and satisfying enough that you could actually play against your own creation at the end. It taught minimax in a way chess could not, because every branch of the tic tac toe game tree could be drawn on paper if necessary and checked against the program's actual behavior.

This pedagogical role kept tic tac toe visible in computer science curricula long after it stopped being an active research frontier. Even today, introductory AI courses routinely use it as the first game-playing assignment before moving to problems that require heuristic evaluation rather than complete search.

From Cathode-Ray Tubes to the Browser Tab

What is striking about tic tac toe's history is how stable the underlying logic has remained while the medium around it changed beyond recognition. Douglas implemented minimax on a machine that filled a room and required a telephone dial to operate. The same algorithm now runs in milliseconds on hardware that fits in your pocket and costs less than a night out.

If you want to feel the full span of that transition in about thirty seconds, you can play tictactoe right now in your browser, and the strategic logic you are playing against is a direct descendant of what Douglas built in 1952. The interface is different. The response time is different. But the decision tree the computer searches before making each move, and the way it evaluates positions by working backwards from every possible outcome, has not fundamentally changed.

That continuity is part of what makes tic tac toe unusual in the history of computing. Most early programs are simply obsolete, replaced by tools so different they share nothing but a general category. Tic tac toe is different because the problem was solved correctly the first time. Once you have a perfect minimax implementation, there is nothing left to improve on the algorithmic side. The only thing that changes is how fast the hardware runs it and how the board is rendered to the player.

Where a Nine-Square Grid Led Us

Douglas was a graduate student writing a thesis. He was not trying to start an industry or plant a flag for posterity. He needed a demonstration problem, found one that fit his hardware constraints, built it, defended his thesis, and moved on. The fact that OXO is still cited and written about more than seventy years later would probably surprise him.

But the choice he made, to build something that could play a game with a provably correct strategy on a machine with almost no memory, turned out to contain the seeds of everything that followed in computational game theory and AI research. Tic tac toe was never interesting as a human game. Adults outgrow it quickly because the optimal strategy is too simple to sustain any tension. For computers, though, it was exactly the right size at exactly the right moment. Small enough to solve completely. Structured enough to teach something real. Provable enough that you could know, with certainty, whether your machine was thinking correctly.

That combination of properties made it the first game a computer ever learned to play. And the fact that you can still play it, against an opponent running the same logic on incomparably better hardware, is a small but genuine connection to where all of this began.