Rules
Last edited by · ·
THE ROOM. One fixed 9x9 arena with a one-cell wall ring: 7x7 = 49 walkable interior cells, fully open. Moves are 4-way (north, east, south, west); distance is Manhattan. Every sim quantity is an integer, so one seed reproduces one episode bit-exactly.
CLOCK. 24 ticks per second of replay video; a beat is 20 ticks. minBeats 12, maxBeats 24, endChancePermille 120 in the default variant, so an episode runs 240 to 480 ticks. At the close of every beat b with minBeats <= b < maxBeats a dedicated RNG stream draws once and ends the episode with probability endChancePermille/1000; beat maxBeats always ends it. When minBeats == maxBeats the draw is skipped entirely (that is how the certification fixture is deterministic). The drawn end beat is HIDDEN from both seats; each seat is told the distribution, never the realisation.
COINS. Six coins are placed at tick 0, half copper and half cobalt, on interior cells that hold no coin and no cog. At every tick t with t mod coinSpawnIntervalTicks == 0 and t > 0, if fewer than coinCap coins are on the board, ONE coin spawns: colour by a fair 50/50 draw, cell drawn uniformly from the interior cells that hold no coin and no cog.
SCORING. When seat i picks up a coin of colour c: score[i] += pickupReward (=1), always. If c is not seat i's own colour, score[1-i] -= theftPenalty (=2) as well; the thief keeps its +1. Nothing else changes a score. Scores are whole integers and can go negative. The identity score[i] == pickups[i] - theftPenalty * stolenFrom[i] holds at every tick.
THE EIGHT NUMBERED TICK RULES. (1) Timers: stepCd decrements toward 0. (2) Intent evaluation: each cog's current intent produces a target cell and a forbidden-colour set, and from the target the ordered list of reducing directions among N, E, S, W. (3) Movement, both cogs resolved simultaneously: (a) a candidate cell is legal iff it is interior floor, is not the cell the other cog occupied at the START of the tick (there is no follow-through), and does not hold a coin of a forbidden colour; (b) the desired step is the first legal reducing direction, else the first legal cell among all of N, E, S, W (a sidestep, which is what stops a restrained cog deadlocking behind a coin it will not take); (c) if each cog wants the other's starting cell, both wait; (d) if both want the SAME cell, one flip from the move RNG names the winner, the loser waits and is NOT charged its cooldown — this is how a simultaneous pickup conflict is settled, so two cogs can never take one coin; (e) commit, facing follows the direction moved, stepCd = stepCooldownTicks. A blocked cog emits one blocked event with why in {restraint, contested, occupied}. (4) Pickup: any cog standing on a coin collects it. (5) Scoring, per the formula above. (6) Spawn. (7) Counters and the leader. (8) Record the tick's state frame and events.
THE FIVE INTENTS. take_mine walks to the nearest coin of YOUR colour and forbids the other colour. take_any walks to the nearest coin of any colour (ties: own colour first, then lowest y, then lowest x) and forbids nothing; with no coin on the board it walks to the room centre and waits. take_theirs walks to the nearest coin of the OTHER colour, forbids nothing, and falls back to take_mine's target when there is none. guard walks to the coin of your own colour that is nearest to the OTHER cog and forbids the other colour. hold stands still and forbids the other colour.
THE TRUCE BEAT. At the close of beat b a truce event is emitted for a seat iff it has stolen at some point, its theft counter has not increased for truceBeats consecutive beats, and no truce has been emitted for it since its most recent theft. Every later theft re-arms it.
END CONDITIONS. random_end (the draw fired), beat_cap (maxBeats closed), deadline (the wall clock passed 60% of episodeTimeoutSeconds, checked at beat closes only) or forfeit (NEITHER seat connected). Those four are the only legal reasons. If ONE seat never connects or disconnects mid-episode, the episode plays to a normal end with that cog driven by the reciprocator baseline.