History of AI

What was El Ajedrecista, the first machine that played chess on its own?

· By Robert Scales · 5 min read

Short answer

El Ajedrecista ("The Chess Player") was an electromechanical machine completed around 1912 by the Spanish engineer Leonardo Torres Quevedo that could win one chess endgame, king and rook against a lone king, with no hidden human helping it. It is often called the first real game-playing machine, because it followed fixed rules to choose its own moves and always delivered checkmate.

Long before computers, a Spanish engineer built a machine that could sit across a chessboard from a person and beat them, at least in one small corner of the game. Leonardo Torres Quevedo finished El Ajedrecista ("The Chess Player") around 1912 in Madrid. It handled a single endgame: the machine had a white king and a white rook, and the human had only a black king. However the person moved, the machine kept squeezing the lone king toward the edge of the board until it was checkmated.

That sounds modest, but nothing like it had existed. Earlier "chess automatons," such as the famous Mechanical Turk, were tricks with a skilled player hidden inside. El Ajedrecista had no one inside. Wires, switches and moving parts did all the deciding.

When and where it appeared

Torres Quevedo was already a celebrated inventor. He had built machines that solved algebraic equations, and he designed the Astra-Torres airship, which the French military used. He ran a large mechanical laboratory in Madrid with government support, and his chess machine came out of a broader project he called automática: the study of machines that act on their own.

The machine was completed around 1912 and first shown in Valladolid, Spain, in 1913. In 1914 the University of Paris invited Torres to set up several of his devices in its new laboratory of mechanical physics, and the chess player drew crowds. In November 1915, Scientific American gave it a long illustrated article, subtitled "He Would Substitute Machinery for the Human Mind."

Around 1920 Torres built a second, sleeker version with his son Gonzalo. It used electromagnets hidden under an ordinary chessboard to slide the pieces, and it could announce checkmate out loud with a recorded voice. Both machines survive and still work. They are on display at the Torres Quevedo museum in the civil engineering school in Madrid.

How the machine played

The first version stood upright, like a small cabinet, with the board on its face. The pieces were metal plugs that fit into holes in the squares. When the human pushed the black king into a new square, electrical contacts told the machine where every piece now stood.

The machine first checked whether the human's move was legal. If not, it lit a lamp, a kind of polite protest. After three illegal moves it simply stopped, and someone had to flip a switch to start a new game. If the move was legal, a sliding arm traveled over the board, gripped the right plug, pulled it out and pushed it into its new square.

The clever part was the decision. Torres worked out a short set of rules that always lead to mate in this endgame. He split the board into zones of columns and, depending on where the three pieces stood, the machine picked one of a handful of moves. Here is a simplified version of that logic:

Situation on the boardWhat the machine does
The rook and the black king share a zoneMove the rook away to the far edge column
The rook is more than one row away from the black kingMove the rook one row closer
The rook is one row away and the kings are far apartBring the white king one row closer
The kings face each other at the right distanceGive check with the rook, pushing the black king back a row
OtherwiseMake a small "waiting" move with the king or rook

Repeat those steps and the black king is driven, row by row, to the edge, where the rook delivers mate. The machine did not always find the shortest win, but it never failed to win.

Try it: Set up a chessboard with a white king and rook and a black king. Play the white side using only the rules in the table above, while a friend moves the black king freely. Count how many moves it takes you to deliver mate, then try again from a new starting position.

Why it mattered

Torres was clear about his aim. Old automatons, such as Vaucanson's mechanical duck, copied the look and gestures of living things. He wanted the opposite: machines that ignore appearance and instead achieve the results a person achieves. He compared a sailor watching gauges to steer a submarine with a torpedo that steers itself using similar instruments. If a machine could "decide" among many possible moves in chess, he argued, then far more factory and office work could be automated than people believed.

That is a very modern idea. El Ajedrecista did not learn, and it did not think in any human sense. It followed rules that a person had worked out in advance. But it showed that a machine could take in a situation, weigh it against rules and choose an action by itself. That loop of sensing, deciding and acting sits under every game-playing program since.

The machine also kept turning up at key moments. In 1951 it was demonstrated in Paris at a major conference on calculating machines and human thought, where a photograph shows Gonzalo Torres Quevedo presenting it to Norbert Wiener, the founder of cybernetics. Some historians call it the first computer game.

How is El Ajedrecista different from today's game-playing AI?

El Ajedrecista was a pure rule-follower. Every move came from a recipe Torres wrote by hand, and it could only handle one tiny endgame. It could never improve with practice, and it had no idea what chess was beyond those few rules.

Today's strongest game programs work very differently. IBM's Deep Blue, which beat world champion Garry Kasparov in 1997, combined hand-tuned rules with enormous search through possible future moves. More recently, DeepMind's AlphaGo and AlphaZero learned largely by playing huge numbers of games against themselves, adjusting a neural network (a large web of simple adjustable units loosely inspired by brain cells) until good moves emerged. No human wrote down their strategy move by move.

Yet the family resemblance is real. Like Torres's machine, these systems read the board, evaluate it and pick a move with no person in the loop. The difference is where the knowledge comes from: written in by an engineer in 1912, or learned from experience in 2019. When you read about a new AI system, asking "who wrote the rules, a person or the data?" is a quick way to see how far it has traveled from El Ajedrecista.

Sources

  1. Torres and His Remarkable Automatic Devices — Scientific American Supplement, vol. 80, no. 2079 (scan at the Internet Archive), November 6, 1915
  2. El Ajedrecista — Wikipedia, August 4, 2019

Get the free Guide to Artificial Intelligence

Sign up for the weekly newsletter and receive the free guide: what changed in AI this week, one lesson, one prompt to try. Unsubscribe in one click.

How we handle your address

Back to top

Display

Your choices are saved in this browser only. No data is sent.

Text size
100%
Colours
Reading
More settings
Accessibility statement