ROBOTWAR
Tick: 0

Instructions

value TO regSet a register to a value90 TO AIM
ADD value TO regAdd value to registerADD 5 TO AIM
SUB value TO regSubtract value from registerSUB 1 TO SPEED
MUL value TO regMultiply register by valueMUL 2 TO 1
DIV value TO regDivide register by valueDIV 2 TO 1
JUMP labelGo to label unconditionallyJUMP LOOP
IF v1 op v2 JUMP labelJump if condition is true   ops: = < > #IF 1 = 0 JUMP MISS
CALL labelCall subroutine (saves return address)CALL FIRE
RETURNReturn from subroutine
;LABELDefine a jump target;LOOP
! textComment — ignored by the interpreter! fire when locked

Registers

AIMTurret angle in degrees (0–359). Wraps automatically.
SHOTSet to fire a shell. Value = max range (1–1000). Fires once per tick if heat allows.
RADARRead-only. Returns distance to nearest enemy within ±5° of AIM, or 0 if none.
SPEEDMovement speed (0–5). Robot moves in HEADING direction each tick.
HEADINGDirection of movement in degrees (0–359).
DAMAGERead-only. Current damage (0–100). At 100 the robot is destroyed.
HEATRead-only. Firing heat (0–100). Each shot adds 20; decays 2/tick. Can't fire at 100.
X / YRead-only. Current position in the 1000×1000 arena.
RANDOMRead-only. Returns a random number 0–359 each time it is read.
METERSTotal distance traveled. Write 0 to reset the odometer.
1 – 20General-purpose storage registers. Pre-loaded with their own index (reg1=1 … reg20=20).

Notes

Numbers 1–20 as a source or destination refer to storage registers, not literals. Use 0 or 21+ for literal values in that range.
Robots start at the four corners. Wall collisions deal 2 damage and stop movement.
Shell hits deal 5 damage. Shells expire at their set range or when they leave the arena.