The Unbeatable Machines: How Nim Became the First Computer Game

Long before Pong, machines were beating people at a game. The game was Nim. Here are the three machines that did it, and why they never lost.

1940: a one-ton box that “thinks”

The New York World’s Fair of 1940 promised visitors the World of Tomorrow. In the Westinghouse pavilion, next to a smoking robot called Elektro, stood the Nimatron: a metal cabinet eight feet tall, stuffed with 116 relays and two miles of copper wire.

Four rows of lamps stood in for heaps of matches. You switched some off, pressed a button, and the machine answered. It even paused a couple of seconds before replying, so it would look like it was thinking.

Patent drawing of the Nimatron (US 2,215,544, 1940): the cabinet with the control panel and the cube of lamps on top
The Nimatron as drawn in Westinghouse’s 1940 patent (US 2,215,544). Public domain.

Its inventor, the physicist Edward Condon, said it was played more than 100,000 times and won around 90,000 of them. He later called it a failure: he had built a toy, and missed that the same relays could store any kind of information. A few years later, that idea was called a computer.

1951: the computer Alan Turing played

Ferranti, a British electronics firm that nobody remembers today, had just built one of the first commercial computers. For the 1951 Festival of Britain it needed something simpler that would work on the day. An Australian engineer, John Bennett, suggested a machine that played only Nim.

The Nimrod was the size of a small room, almost all of it vacuum tubes and light bulbs. Visitors pressed buttons, lights showed the game, and a demonstrator explained the logic. Nobody listened. As Bennett admitted, people just wanted to play. One of them was Alan Turing.

In Berlin that autumn, the Nimrod beat West Germany’s economics minister three times in a row. Then Ferranti took it apart. It had made its point.

1966: the doctor who runs on marbles

Twenty-five years later the unbeatable machine cost five dollars. Dr. Nim, invented by a General Electric engineer named Jack Godfrey, was a tilted plastic board with twelve marbles and a handful of levers. No batteries, no wires.

You release your marbles, flip a switch, and gravity does the rest: the falling marbles trip the levers and the machine makes its move. It never errs. There is an “equalizer” lever that gives the human a chance; with it off, Dr. Nim always wins. Enthusiasts still 3D-print replicas today.

The secret: the game was already solved

Relays, vacuum tubes and marbles all chose Nim for the same reason. In 1901 a Harvard mathematician, Charles Bouton, proved that every position in Nim is either won or lost, and gave a simple rule to tell which. A machine does not need to think. It computes one number, the nim-sum, and plays the move that makes it zero.

Chess had to wait decades for computers powerful enough. Nim was waiting for them.

Still unbeatable, now in 3D

Nimplayer plays the same perfect strategy as the Nimrod, with the heaps turned into planets in a galaxy you can spin in your browser. And the only way to beat it is the one Condon’s demonstrators found in 1940: start from a position that is already lost for the machine. Nimplayer lets you choose who goes first. The nim-sum calculator will show you where to look.

Sources

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top