code
A game of Core War running under the pMARS simulator, as seen through the graphical core display.

A game of Core War running under the pMARS simulator, as seen through the graphical core display.

Core War (or Core Wars) is a Programming game in which two or more battle programs (called warriors) compete for the control of the MARS virtual computer (Memory Array Redcode Simulator). These battle programs are written in an abstract Assembly language called Redcode. The object of the game is to cause all processes of the opposing program(s) to terminate, leaving your program in sole possession of the machine.

History

Core War was in part inspired by a game called Darwin (programming game), written by Victor A. Vyssotsky, Robert Morris Sr., and M. Douglas McIlroy at the Bell Labs in the 1960s. The word "Core" in the name comes from Magnetic core memory, an obsolete Random access memory technology. The same usage may be seen in other Computer jargon terms such as "Core dump".

The first description of the Redcode language was published in March 1984, in Core War Guidelines by D. G. Jones and A. K. Dewdney. The game was introduced to the public in May 1984, in an article written by Dewdney in Scientific American ("Computer Recreations" - In the game called Core War hostile programs engage in a battle of bits). Dewdney revisited Core War in his "Computer Recreations" article in March 1985, and again in January 1987.

The International Core Wars Society (ICWS) was founded in 1985, one year after Dewdney's original article. ICWS published new standards for the Redcode language in 1986 and 1988, and proposed an update in 1994 [1] that was never formally set as the new standard. Nonetheless, the 1994 draft was commonly adopted and extended, and forms the basis for 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 the ICWS is defunct.

In 1991, the Newsgroup [news://rec.games.corewar rec.games.corewar] was created. Up to now it remains the most prolific source of Core War related information. Most articles and newsletters on Core War have been published in this newsgroup.

Redcode

0000:  ADD.AB  #   4, $   3
0001:  MOV.F   $   2, @   2
0002:  JMP.B   $  -2, $   0
0003:  DAT.F   #   0, #   0

Assembled ICWS-94 style Redcode

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 differs in many ways from "real" assembly:

Each program can also have several active processes, each having its own Instruction pointer. Each program starts with only one process, but others can be created with the SPL instruction. The processes for each program execute alternately, so that the execution speed of each process is inversely proportional to the number of active processes the program has. A process dies when it executes a DAT instruction or performs a division by zero. A program is considered dead when it has no more processes left.

The ICWS-88 Instruction Set

            instructions
  DAT - a data value, non-executable.
  MOV - move data from one address to another
  ADD - add two values and store in the second location
  SUB - subtract two values and store in the second location
  CMP - compare two locations and skip an instruction if they contain
        identical information
  JMP - unconditional jump to some address
  JMZ - jump to some address on the condition of some data value being zero
  JMN - jump to some address on the condition of some data value being
        non-zero
  SPL - split into two processes, one starting at the next address and one at
        a specified address
  DJN - decrement some data value and jump to some address if the value
        decremented is now not zero
        
            addressing modes
  # - immediate
  $ - direct
  @ - indirect
  < - indirect with predecrement

Strategy

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.

Variants

See also

External links

Documents

Programs

Tournaments

Smallwikipedialogo.png This page uses content from Wikipedia. The original article was at Core War. The list of authors can be seen in the page history. As with the Programmer's Wiki, the text of Wikipedia is available under the GNU Free Documentation License.