At the start of a match, each warrior is loaded into a random memory location. Programs take turns executing one instruction at a time. A program wins by terminating all opponents, typically by causing them to execute invalid instructions, leaving the victorious program in sole possession of the machine.
Early versions of Redcode featured only eight instructions. This number increased to 10 in the ICWS-86 standard, 11 in ICWS-88, and 16 in the 1994 draft standard, which is still widely used. With various addressing modes and instruction modifiers introduced in the 1994 draft, the total number of possible operations is 7168. Redcode does not define how instructions are represented in memory, nor does it allow programs to inspect their own code structure beyond copying and equality comparisons. Arithmetic operations are limited to the instruction’s two address fields.
A number of versions of Redcode exist. The earliest version described by A. K. Dewdney1 differs in many respects from the later standards established by the International Core War Society, and could be considered a different, albeit related, language. The form of Redcode most commonly used today is based on a draft standard submitted to the ICWS in 1994 that was never formally accepted, as the ICWS had become effectively defunct around that time. Development of Redcode, however, has continued in an informal manner, chiefly via online forums such as the rec.games.corewar2 newsgroup.
Warriors are commonly divided into a number of broad categories, although actual warriors may often combine the behavior of two or more of these. Three of the common strategies (replicator, scanner and bomber) are also known as paper, scissors and stone, since their performance against each other approximates that of their namesakes in the well-known playground game.3
Hydra
Hydras launch multiple copies of tiny bombers or core clears.10
Bootstrap
Bootstraps copy one or more of it's components away from their original location, leaving a decoy to attract
Scanners and Quickscanners.11
With an understanding of Core War strategies, a programmer can create a warrior to achieve certain goals. Revolutionary ideas come once in a while; most of the time, however, programmers base their programs on already published warriors. Using optimizers such as OptiMax or core-step optimizer tools, a more effective warrior can be created.
Warriors can also be generated by genetic algorithms or genetic programming. Programs that integrate this evolutionary technique are known as evolvers. Several evolvers were introduced by the Core War community and tend to focus on generating warriors for smaller core settings. The latest evolver with significant success was μGP1213 which produced some of the most successful nano and tiny warriors. Nevertheless, evolutionary strategy still needs to prove its effectiveness on larger core settings.14
Core War was inspired by a self-replicating program called Creeper and a subsequent program called Reaper that destroyed copies of Creeper.15 Creeper was created by Bob Thomas at BBN.16 Dewdney was not aware of the origin of Creeper and Reaper and refers to them as a rumor originating from Darwin and the worm experiments of Shoch and Hupp. The 1984 Scientific American article on Core War17 nevertheless cites the game Darwin, played by Victor A. Vyssotsky, Robert Morris, and Douglas McIlroy at Bell Labs in 1961.
The word "Core" in the name comes from magnetic-core memory, an obsolete random-access memory technology. This term was then, and still today, typically in use as the term for working memory in working memory dumps, called core dumps, on Unix and most Unix-like systems. Additionally, the default filename used for core dumps on such systems is usually "core" or contains the word core.
The first description of the Redcode language was published in March 1984, in Core War Guidelines by D. G. Jones and A. K. Dewdney.18 The game was introduced to the public in May 1984, in an article written by Dewdney in Scientific American. Dewdney revisited Core War in his "Computer Recreations" column in March 1985,19 and again in January 1987.20
The International Core Wars Society (ICWS) was founded in 1985, one year after Dewdney's original article. The ICWS published new standards for the Redcode language in 1986 and 1988, and proposed an update in 1994 that was never formally set as the new standard.21 Nonetheless, the 1994 draft was commonly adopted and extended, and forms the basis of the de facto standard for Redcode today. The ICWS was directed by Mark Clarkson (1985–1987), William R. Buckley (1987–1992), and Jon Newman (1992–); currently[when?] the ICWS is defunct.22
Redcode is the programming language used in Core War. It is executed by a virtual machine known as a Memory Array Redcode Simulator, or MARS. The design of Redcode is loosely based on actual CISC assembly languages of the early 1980s, but contains several features not usually found in actual computer systems.
Both Redcode and the MARS environment are designed to provide a simple and abstract platform without the complexity of actual computers and processors. Although Redcode is meant to resemble an ordinary CISC assembly language, it is quite simplified relative to "real" assembly, and has no absolute memory addressing
The original 8 instructions are described as follows. Later versions added NOP, multiply and more complex comparisons.23
The ICWS '94 draft standard added more addressing modes, mostly to deal with A-field indirection, to give a total of 8 modes:
Development of implementations of the game continued over the years by several authors. There are multiple versions of the game available,24 ported for several platforms. For instance pMARS which is open source software with source code on SourceForge,25 or the SDL based SDL pMARS for Windows.26
The common implementation pMars was downloaded over 35,000 times between 2000 and 2021 from SourceForge.27
Jones, D. G.; Dewdney, A. K. (March 1984). "Core War Guidelines". Retrieved 2023-05-27. /wiki/A._K._Dewdney ↩
"rec.games.corewar on Google Groups". Retrieved 2023-05-29. https://groups.google.com/g/rec.games.corewar ↩
Wangsaw, Mintardjo. "Intro to Art in '88: Paper - Stone - Scissors Trilogy". Retrieved 2023-05-27. https://corewar.co.uk/mintard/index.htm ↩
Pohjalainen, Jippo. "Silk Warrior 1.3". Retrieved 2025-03-02. https://asdflkj.net/COREWAR/94/HILL32/silkwarrior13.red ↩
Pohjalainen, Jippo (April 1995). "replicators? -> Phoenix & TimeScapesource". Retrieved 2023-05-27. https://groups.google.com/g/rec.games.corewar/c/D2q6OlEnXUo/m/9On9BfVvmU0J ↩
Metcalf, John (April 2004). "Anatomy of the Scanner, A Basic Introduction". Retrieved 2023-05-27. https://corewar.co.uk/metcalf/scanner.htm ↩
van Rijn, Roy. "Myrmidon". Retrieved 2025-03-02. https://asdflkj.net/COREWAR/94/HILL32/myrmidon.red ↩
Paulsson, Magnus. "myVamp v3.7". Retrieved 2025-03-02. https://asdflkj.net/COREWAR/94/HILL32/myvamp37.red ↩
Dewdney, A. K. "Imp". Retrieved 2025-03-02. /wiki/A._K._Dewdney ↩
"Core War Strategy Guide". Retrieved 2024-05-12. https://corewar.co.uk/strategy.htm ↩
"Core War Strategy Guide". Retrieved 2025-05-12. https://corewar.co.uk/strategy.htm ↩
Squillero, Giovanni. "μGP (MicroGP v2)". GitHub. Retrieved 2018-09-10. https://github.com/squillero/microgp2/ ↩
Corno, F.; Sanchez, E.; Squillero, G. (2005). "Evolving Assembly Programs: How Games Help Microprocessor Validation". IEEE Transactions on Evolutionary Computation. 9 (6): 695–706. doi:10.1109/TEVC.2005.856207. ISSN 1089-778X. https://citeseerx.ist.psu.edu/document?repid=rep1&type=pdf&doi=6026078bb5915689d4a4efcc26d541617f53182a ↩
Vowk, Barkley; Wait, Alexander; Schmidt, Christian. "An Evolutionary Approach Generates Human Competitive Corewar Programs" (PDF). Retrieved 2023-05-27. https://corewar.co.uk/vowk/alife9ac.pdf ↩
Dewdney, A. K. (May 1984). "In the game called Core War hostile programs engage in a battle of bits". Scientific American. Retrieved 2023-05-27. /wiki/A._K._Dewdney ↩
Shoch, J.; Hupp, J. (March 1982). "The 'Worm' Programs - Early Experience with a Distributed Computation". Communications of the ACM. 25 (3): 172–180. doi:10.1145/358453.358455. S2CID 1639205. /wiki/John_Shoch ↩
Dewdney, A. K. (March 1985). "A Core War bestiary of viruses, worms and other threats to computer memories". Scientific American. Retrieved 2023-05-27. /wiki/A._K._Dewdney ↩
Dewdney, A. K. (January 1987). "A program called MICE nibbles its way to victory at the first Core War tournament". Scientific American. Retrieved 2023-05-27. /wiki/A._K._Dewdney ↩
Doligez, Damien; Durham, Mark (8 November 1995). "Annotated Draft of the Proposed 1994 Core War Standard". Retrieved 2023-05-27. https://corewar.co.uk/standards/icws94.txt ↩
Metcalf, John. "A Brief History of Corewar". Retrieved 2023-05-27. https://corewar.co.uk/history.htm ↩
"The beginners' guide to Redcode, v1.23". https://vyznev.net/corewar/guide.html#start_instr ↩
The Corewar Emulators on corewar.info http://corewar.info/emulator.htm ↩
corewar on SourceForge https://sourceforge.net/projects/corewar/ ↩
pMARS-SDL on corewar.co.uk by Joonas Pihlaja (7 May 2003) https://corewar.co.uk/pihlaja/pmars-sdl/index.htm ↩
download numbers corewar on SourceForge (access 2021-06-07) https://sourceforge.net/projects/corewar/files/stats/timeline?dates=2000-03-01%20to%202021-06-01&period=monthly ↩