Chess is one of the oldest, and most revered games of strategy and analysis in the world. It’s a game so intricate that some spend their entire lives trying to master it. Nearly 60 years ago, a new player entered the game–one powered not by human intelligence and dedication, but by lines of code on paper, written by computer scientist Alan Turing.

The most well-known chess-playing computer is IBM’s Deep Blue, which faced off against Russian chess grandmaster Garry Kasparov in a much-publicized series of matches in February 1996. Deep Blue was not the first computer program for chess, however. That distinct honor goes to an algorithm named “Turochamp,” which was written by famed British computer scientist, mathematician and cryptanalyst Alan Turing in the late 1940s.

Known by many historians as the “father of computer science,” Turing first made a name for himself when he perfected the Bombe–a mechanical device used by British intelligence to decipher encrypted messages sent using the German Enigma machine during World War II. Turing’s achievements are considered a turning point of the war.

An Enigma cipher machine that belonged to codebreaker Alan Turing at Bonham's Auction House, New York City. (Credit: Spencer Platt/Getty Images)
Spencer Platt/Getty Images
An Enigma cipher machine that belonged to codebreaker Alan Turing at Bonham’s Auction House, New York City.

Turing continued his work in the computer science field, even working with primitive forms of artificial intelligence. His work with A.I. quickly led him to tackle chess, which he saw as a way to test the true mettle of an artificial brain. (The term “A.I.” wasn’t coined until 1956, two years after Turing’s untimely death).

Turing began working on his algorithm in 1948 before computers were even capable of executing complex calculations. Still, Turing pressed on and finished his code in 1950. The algorithm was crude. Its logic was based on just a few of the most basic rules of chess, and it was only able to “think” two moves in advance. To put that in context, Garry Kasparov, who is considered one of the best players in the world, has stated that he typically calculates three to five moves ahead, but can look ahead as many as 12 or 14 moves, depending on the situation.

Once the code was written, Turing set out to test it on a working computer. After failed attempts at implementing the algorithm using the Ferranti Mark I–the world’s first commercially available general-purpose computer–in 1951, Turing decided to demo the algorithm’s capabilities without using a computer at all.

He challenged his friend and colleague Alick Glennie, with the caveat that Turing would play the game using a paper-printed version of his code. When it was Turing’s turn to make a move, he would consult the algorithm and use its “logic” to decide which pieces to move, and where. Because he had to analyze every move as his program would, Turing took upwards of 30 minutes to work through the strategy each time his turn came. “Turochamp “showed it was fully capable of playing against a human in chess—but not winning. Glennie defeated Turing in just 29 moves.

Turing never got to see his program executed by an actual computer. He died from cyanide poisoning in 1954–two weeks shy of what would have been his 42nd birthday. Turing had been prosecuted, and chemically castrated, due to his relationship with another man in 1952. Turing’s wartime triumphs and early artificial intelligence accomplishments fell into obscurity. The British government didn’t declassify the work of Turing and his Bletchley Park colleagues until the 1970s and Turing’s own record of the cracking of the Enigma code wasn’t published until the 1990s.

In June 2012, as part of the University of Manchester’s Alan Turing Centenary Conference, “Turochamp” finally got a chance to prove its acumen in front of the world. The algorithm’s opponent that day? Garry Kasparov, of course.

HISTORY Vault

Stream thousands of hours of acclaimed series, probing documentaries and captivating specials commercial-free in HISTORY Vault

The little program from 1950 was no match for the Russian grandmaster, who had won against IBM’s “Deep Blue” back in 1996, but later lost to an IBM supercomputer in 1997. The man who many think is the greatest chess player of all time mopped the floor with Turochamp in just 16 moves. Afterward, the victorious Kasparov paid tribute to the legendary programmer, stating: “I suppose you might call it primitive, but I would compare it to an early car—you might laugh at them but it is still an incredible achievement.”

“[Turing] wrote algorithms without having a computer—many young scientists would never believe that was possible. It was an outstanding accomplishment.”