Darwin (programming game)
Darwin was a programming game invented in August 1961 by Victor A. Vyssotsky, Robert Morris Sr., and M. Douglas McIlroy. (Dennis Ritchie is sometimes incorrectly cited as a co-author, but was not involved.) The game was developed at Bell Labs, and played on an IBM 7090 mainframe there. The game was only played for a few weeks before Morris developed an "ultimate" program that eventually brought the game to an end, as no-one managed to produce anything that could defeat it.
The game consisted of a program called the umpire and a designated section of the computer's memory known as the arena, into which two or more small programs, written by the players, were loaded. The programs were written in 7090 machine code, and could call a number of functions provided by the umpire in order to probe other locations within the arena, kill opposing programs, and claim vacant memory for copies of themselves.
The game ended after a set amount of time, or when copies of only one program remained alive. The player who wrote the last surviving program was declared winner.
Up to 20 memory locations within each program (fewer in later versions of the game) could be designated as protected. If one of these protected locations was probed by another program, the umpire would immediately transfer control to the program that was probed. This program would then continue to execute until it, in turn, probed a protected location of some other program, and so forth.
While the programs were responsible for copying and relocating themselves, they were forbidden from altering memory locations outside themselves without permission from the umpire. As the programs were executed directly by the computer, there was no physical mechanism in place to prevent cheating. Instead, the source code for the programs was made available for study after each game, allowing players to learn from each other and to verify that their opponents hadn't cheated.
The smallest program that could reproduce, locate enemies and kill them consisted of about 30 instructions. McIlroy developed a 15-instruction program that could locate and kill enemies but not reproduce; while not very lethal, it was effectively unkillable, as it was shorter than the limit of 20 protected instructions. In later games the limit on protected instructions was lowered because of this.
The "ultimately lethal" program developed by Morris had 44 instructions, and employed an adaptive strategy. Once it successfully located the start of an enemy program, it would probe some small distance ahead of this location. If it succeeded in killing the enemy, it would remember the distance and use it on subsequent encounters. If it instead hit a protected location, then the next time it gained control it chose a different distance. Any new copies were initialized with a successful value. In this way, Morris's program evolved into multiple subspecies, each specifically adapted to kill a particular enemy.
- Aleph Null "Computer recreations: Darwin", Software: Practice and Experience, Vol. 2, Issue 1, pp. 93–96 (January/March 1972)
- McIlroy, M. D., Morris, R., Vyssotsky, V. A. (1971). "Darwin, a Game of Survival of the Fittest among Programs" (HTML version)
- Metcalf, John. "Darwin: Survival of the Fittest among Programs"