El Ajedrecista


El Ajedrecista is a chess-playing automaton designed by the Spanish engineer and inventor Leonardo Torres Quevedo. First demonstrated in 1913 and later exhibited in Paris in 1914, it played a simplified chess endgame with three chess pieces on a dedicated board without any human operator. A second, more compact electromechanical version was completed around 1920.
Unlike earlier so-called chess “automatons” such as the Mechanical Turk, Mephisto and Ajeeb, which relied on concealed human players, El Ajedrecista was a genuinely autonomous machine, playing chess without human guidance. It implemented the rules of the chosen endgame mechanically and electromechanically, detecting the opponent’s moves via an array of electrical contacts beneath the board and responding by moving its own pieces via an internal mechanism that enforced legal play and executed checkmate automatically.
Widely regarded as the first computer game in history, El Ajedrecista is considered one of the earliest genuine game-playing machines and a landmark in the development of decision-making automation and computer chess, anticipating later software-based chess programs by several decades.

History

After developing several algebraic calculators, Torres Quevedo began experimenting with automation and remote control during the first decade of the 20th century, developing a series of electromechanical “automaton” devices he collectively termed automática. In 1901 he presented his wireless remote-control system, the Telekine, which influenced his later work on chess automation, to remotely testing airships of his own creation without risking human lives.
El Ajedrecista was completed in 1912 and exhibited for the first time in Valladolid, Spain in 1913. It created great excitement when it made its debut, at the French Academy of Sciences in 1914. The device could be considered the first computer game in history. It was widely mentioned in Scientific American as "Electric Automaton" on 16 May 1914 and as "Torres and His Remarkable Automatic Devices" on November 6, 1915.
A second version, constructed in 1920 and presented in 1923, improved the reliability of the piece-movement system and eliminated visible mechanical supports through the use of electromagnets installed under a standard chessboard. In 1951, El Ajedrecista was presented at the influential French symposium "Les Machines à calculer et la pensée humaine", where it defeated Savielly Tartakower being the first Grandmaster to lose against a machine. The Austrian computer pioneer Heinz Zemanek played against the second version at the 1958 Brussels World's Fair. Both automatons are still in working condition and are on display at the Museo Torres Quevedo in the Escuela de Ingenieros de Caminos, Canales y Puertos in Madrid.

Technical description

Its internal construction was published by Henri Vigneron. The pieces had a metallic mesh at their base, which closed an electric circuit that encoded their position in the board. When the black king was moved by hand, an algorithm calculated and performed the next best move for the white player.
Torres defined two zones for use in his algorithm, the first consisting of the a-, b-, and c-files, and the second consisting of the f-, g-, and h-files. The algorithm is as follows:
If the black King
  • is in the same zone as the rook
  • * then the rook moves away from the zone to either the a- or the h-file.
  • is not in the same zone as the rook and the vertical distance between the black king and the rook is
  • * more than a square
  • ** then the rook moves one square vertically towards the black king.
  • * one square, with the vertical distance between the two kings being
  • ** more than two squares
  • *** then the king moves one square vertically towards the black king.
  • ** two squares, with the number of squares representing their horizontal distance apart being
  • *** odd
  • **** then if the rook is on the a- or h-file, it moves to the b- or g-file respectively, and vice versa.
  • *** even
  • **** then the white king moves one square horizontally towards the black king.
  • *** zero
  • **** then the rook moves one square vertically towards the black king.
Torres Quevedo’s automaton was built to play a fixed rook-and-king versus king endgame. The following diagrams and annotated line illustrate a complete forced mate in 21 moves from a typical starting position. This line is not necessarily the fastest mate, but it illustrates the type of deterministic endgame algorithm that El Ajedrecista implemented mechanically: restricting the opposing king with the rook, bringing the white king closer, driving the black king to the corner, and delivering a supported rook mate to the black King, who performs the best defense according to a chess endgame tablebase, recorded in Portable Game Notation.
The automaton does not deliver checkmate in the minimum number of moves, nor always within the 50 moves allotted by the fifty-move rule, because of the simple algorithm that calculates the moves. It did, however, checkmate the opponent every time. This illustrates the deterministic procedure described by Torres Quevedo in his "'Ensayos sobre automática", where he argued that certain classes of problems, such as elementary chess endings, could be executed entirely by mechanical and electromechanical devices following fixed logical rules and logical constraints. If an illegal move was made by the opposite player, the automaton would signal it by turning on a light. If the opposing player made three illegal moves, the automaton would stop playing.
In the first version, the pieces were plugged into the board, and the game states of check and checkmate were signaled with light bulbs. Leonardo's son Gonzalo made an improved chess automaton based on El Ajedrecista in 1920, which made its moves via electromagnets located under an ordinary chess board. It also included a sound effect, with a voice recording announcing checkmate when the computer won the game.