An homage to AT-Robots, the DOS game of 1992: you wrote a tank in a small assembly language and watched it fight. Write one below, in the spirit of the original, pick your opponents from the presets, and press fight. Everything runs in this page.
pick your opponents, write your tank, and fight.
Nine presets, each a lesson: six ways to fight, RICK, who learns, JOSH, who hurdles, and DICE, who rolls. Tick the ones to fight, and read one to load it into the editor.
A program is lines of op a, b. Operands are the registers ax bx cx dx, numbers, memory as
[n] or [ax], and labels, written :name on a line of their own. Comments start with
;. Every tick each tank runs five instructions; delay n spends n of them.
| arithmetic | mov add sub mpy div mod and or xor not neg xchg |
|---|---|
| compare, jump | cmp a, b then jmp je jne jg jl jge jle to a label |
| calls, stack, loops | call ret push pop; do n then loop label |
| ports | opo port, value writes, ipo port, place reads |
| read ports | speedo (1) heat (2) compass (3) tofs turret offset (4) theading (5) damage (6) scan range in the arc, 0 for none (7) accuracy where in the arc, −2..2 (8) radar range to the nearest, any direction (9) random (10) |
| write ports | throttle −75..100 (11) rotate the turret by (12) aim set the turret offset (13) steer turn the body by (14) fire with an adjustment of −4..4 (15) arc the scanner's half-angle, 1..64 (17) overburn 1 or 0 (18) shutdown the heat to shut down at (20) |
| interrupts | int @locate ax, bx = x, y · int @keepshift ax = 1 to let the turret keep its heading · @overburn · @id · @timer · @angle ax, bx = a point, ax = the heading to it · @game ax = tanks alive · @collisions · @resetcol · @kills · @reset · @destruct |
| config | #config scanner=3 weapon=3 armor=2 engine=2 heatsinks=2: twelve points, 0 to 5 each. Scanner is range, weapon is damage, armor is what you take, engine is speed, heatsinks shed the heat that firing and overburn build. At 475 heat a tank shuts down until it cools; at 500 it burns. |
Headings are degrees, 0 to the right, clockwise on screen. The arena is 1000 by 1000. Walls hurt with the square of the speed; ramming costs both tanks. A missile flies straight, a little wild, and a tank fires at most every eight ticks. After a minute everyone loses two points of armor a second, so a match that has gone quiet still ends; it ends with one tank standing, or on armor.