Standards and rule sets
AI notice: This text is created with the support of AI systems; it is reviewed editorially and taken responsibility for before publication.
Core War has no single binding standard but a history of them. Anyone reading a foreign warrior or submitting their own should know which rule set it was meant for — otherwise you will wonder about instructions that should not exist, or about error messages for perfectly correct code.
The three that matter
ICWS'88 is the first official standard of the International Core Wars Society. It is considerably smaller than what is common today, and you will mainly meet it in old warriors from the early nineties.
ICWS'94 is a draft that was never formally ratified — and became the de facto standard anyway. Practically everything played today follows it. It adds modifiers, extra addressing modes and new instructions.
'94nop is ICWS'94 without p-space. The "nop" stands for no p-space. This is the rule set the most important hills run on, and the basis for every example in this reference.
What '88 cannot do
The difference is concrete. The same source, assembled once under '94nop and once under '88 — under '88 it fails in five places:
MOV.I $1, $2 ; error: '88 has no modifiers
MOV *1, $2 ; error: A-indirect (*) does not exist
MOV {1, }2 ; error: A-field pre/post modes do not exist
SEQ $1, $2 ; error: called CMP in '88
MUL $1, $2 ; error: MUL, DIV, MOD do not exist
Under '94nop the same code assembles without complaint.
In summary — what ICWS'94 adds over '88:
| New in '94 | Meaning |
|---|---|
Modifiers (.A … .I) |
In '88 the field behaviour is fixed in the opcode. |
* { } |
A-field indirection and its counters. '88 has only the B variants. |
MUL DIV MOD |
Arithmetic beyond addition and subtraction. |
SEQ SNE |
SEQ replaces CMP (both names allowed), SNE is new. |
NOP |
Explicitly do nothing. |
LDP STP |
Access to p-space. |
An '88 warrior therefore usually runs under '94 as well; the reverse almost never works.
P-space, and why most hills do without it
P-space (private storage) is a small memory area belonging to a warrior
that survives a round. It writes into it with STP and reads back with
LDP.
That lets a warrior learn: it remembers how the last round went and switches strategy after repeated losses. On a hill with several hundred rounds per pairing, that is a genuine extra dimension.
The usual size is one sixteenth of the core size — 500 cells for a core of 8000.
Nevertheless the best-known hill runs without p-space, for an understandable reason: p-space makes warriors stateful. A result then depends not only on the current round but on the history. That makes reproducible measurement considerably harder — and it makes warriors harder to understand, because the same program behaves differently depending on what happened before.
Under '94nop, LDP and STP are therefore disabled.
The settings
A rule set alone is not enough — the battle parameters go with it. The most important:
| Parameter | Meaning | '94nop |
|---|---|---|
| Core size | cells in the ring | 8000 |
| Cycles | until a tie is declared | 80,000 |
| Processes | maximum concurrent per warrior | 8000 |
| Length | maximum cells per warrior | 100 |
| Distance | minimum separation at load time | 100 |
As a pMARS command line:
pmars -s 8000 -c 80000 -p 8000 -l 100 -d 100 -r 200 warrior.red opponent.red
These five numbers are why warriors look the way they do. The 100-cell length limit forces the extreme density; the 80,000 cycles decide whether a slow strategy can arrive at all; the minimum distance of 100 prevents a warrior from starting right next to its opponent and overwriting it immediately.
Other hills exist with different numbers — with very small cores, very short warriors, or a severely limited process count. Each produces its own ecosystem in which different strategies work. The binding values are stated in the description of the hill in question; do not rely on second-hand figures, they change occasionally.
What belongs in a warrior's header
These lines are not comments in the usual sense but are evaluated by the hill servers:
;redcode-94nop
;name My Warrior
;author Your Name
;strategy Briefly, what it does.
;assert CORESIZE == 8000
;redcode-<hill>must be on line 1 and determines the target hill.;assertmakes assembly fail if the environment does not match — sensible for core size and process limit, which your constants are tuned to.- No
;asserton the number of rounds. Some hills pre-assemble with different settings; the check then fails although nothing is wrong with the warrior.
More on submitting under Onto a hill.
Related pages
- Instruction set — all 16 opcodes
- Addressing modes — the eight modes
- Modifiers — which fields an instruction touches