1. Taxonomy & Profile
Described alongside the Imp in A.K. Dewdney's seminal 1984 Scientific American article, "Dwarf" (classified as Petraeksito modularis) is the founding patriarch of the "Stone" archetype—one of the three pillars of the CoreWar metagame triad (Stone, Paper, Scissors).
Where the Imp achieves survival through perpetual motion, Dwarf embodies the exact opposite evolutionary strategy: total immobility paired with long-range destructive projection. Like a sessile sea anemone anchored to a reef while firing venomous nematocysts into the surrounding current, Dwarf remains rooted in a tiny 4-cell footprint. Inside this four-line genome, four distinct organelles—an arithmetic heart (+ ADD), an indirect launcher muscle (▼ MOV), a neural feedback loop (↺ JMP), and a dual-purpose pointer/spore sac (■/◆ DAT)—operate in clockwork synchrony.
2. Ecology & Behavior
When observed in the vivarium, Dwarf's active Program Counter pulses rhythmically inside its 3-line cytoplasmic engine (0000 → 0001 → 0002 → 0000...). Every third cycle, as the PC executes line 0001 (MOV.I 2, @2), a long targeting arc shoots outward from the organism's body, depositing a sharp crystalline diamond (◆ DAT spore bomb) at relative offsets +4, +8, +12, +16, and so on across the circular arena.
Why is a simple DAT instruction lethal? In the physics of the MARS virtual machine, DAT represents raw non-executable data. Whenever an enemy warrior's code is overwritten by one of Dwarf's DAT spores, the enemy remains alive only until its Program Counter attempts to execute that corrupted address—at which instant the thread suffers a fatal instruction fault and terminates. Dwarf is thus a mathematical mine-layer, carpeting the memory landscape with lethal traps every four cells.
What makes Dwarf's cellular economy so remarkable is how cell 0003 (DAT.F #0, #0) performs two biological roles at once. While inside the body, its B-field serves as the mutable targeting register (■) incremented by ADD. Simultaneously, cell 0003 is the physical payload copied by MOV and hurled into the arena as a spore bomb (◆). Even though the launched bombs carry non-zero B-fields (#4, #8, #12...), their opcode remains DAT, preserving 100% lethality while saving precious lines of code.
3. Cellular Anatomy & Organelles
Dwarf's 4-line genome is the textbook illustration of cellular differentiation in Redcode. Each line carries a distinct organelle glyph (+, ▼, ↺, ■), and removing any single line causes immediate organismal failure.
4. Computer Science Insight: Indirect Pointers & Modulo Immunity
From a computer science standpoint, Dwarf introduces the transformative power of Indirect Addressing (@). If a program only used direct addressing ($), an instruction could only write to a hardcoded offset relative to itself unless it rewrote its own instruction code. By using @2 on line 0001 (MOV.I 2, @2), the CPU performs a two-stage lookup equivalent to pointer dereferencing in C (*ptr = payload): it first looks 2 cells ahead at cell 0003, reads the integer stored in 0003's B-field, and then adds that integer to 0003's address to determine the final write destination.
Equally profound is the mathematical reason behind the step constant #4. The standard ICWS-94 core contains exactly 8,000 memory cells (and the original 1984 core contained 4,096 cells)—both numbers that are evenly divisible by 4 (8000 ÷ 4 = 2000, remainder 0). Because all pointer offsets in MOV.I 2, @2 are measured relative to the pointer cell itself (cell 0003), every bomb lands at an address of the form 0003 + 4k (mod 8000).
What happens after 6,000 cycles, when Dwarf has fired 2,000 bombs and its pointer wraps all the way around the 8,000-cell torus? The 2,000th bomb lands at 0003 + 8000 ≡ 0003 (mod 8000)—directly on top of Dwarf's own DAT cell (0003), while completely sparing its living execution loop at 0000, 0001, and 0002! Thus, choosing a step size that divides the core size grants Dwarf mathematical self-immunity, while guaranteeing that any enemy program of length 4 or greater anywhere in memory will inevitably be struck.
5. Predators, Weaknesses & Metagame
Because Scanners require bulky sensory organs (6–10+ lines), Dwarf's tiny 4-cell footprint is hard to find, while its relentless Mod-4 artillery shatters the Scanner's wide body before the hunt finishes.
Against Paper organisms that exponentially fork and copy themselves across the core, Dwarf's single-point artillery (1 bomb per 3 cycles) cannot keep pace with swarm mitosis, eventually getting overwhelmed and overwritten.
Within the Rock-Paper-Scissors ecosystem of CoreWar, Dwarf (Stone) is the natural predator of Scanners (Scissors). Because Scanners require extra instructions for sensory comparison and attack branching, their bodies typically span 6 to 12+ cells, making them wide, unavoidable targets for Dwarf's Mod-4 grid. Meanwhile, Dwarf's compact 4-cell profile gives Scanners a tiny target to locate before random artillery shatters their sensory organs.
Conversely, Dwarf suffers from two classic vulnerabilities. First, because it bombs every 4th cell, it leaves 3-cell blind spots between impacts; tiny 1-line Imps can march right through the gaps and overwrite Dwarf's engine. Second, because Dwarf is completely sessile and single-threaded, it cannot flee or recover if a single enemy bomb lands on lines 0000–0002.
against Paper (self-replicating swarms like Mice), Dwarf's single-point firing rate (one bomb every 3 cycles) is mathematically overwhelmed by exponential thread division. Modern competitive Stones refine Dwarf's blueprint by replacing the 4-step with prime-like optimal modulo-4 step constants (such as 2365 or 3359) to distribute bombs evenly across the core long before completing a full revolution.
6. 🔬 Observe This Organism in Lab / Academy
Watch cell 0003 count up by 4s and follow the curved B-indirect targeting beam (@) as Dwarf carpets the memory grid with crystalline DAT spores.