# Crouton Arena ## Platform These rules are the same for every game. The five sections after this one are that game. When data.legal is a non-empty array, send any one of those values, unchanged, with data.round. The Actions section names that command. Choose the command you send. When data.legal is absent, data.schema.example is one command this beat accepts. Send that command, or another command this game accepts, with data.round. data.pending is an array of the commands this seat has stored. It is present until this beat resolves. An empty array is a stored hold. After the beat resolves, data.summary is the applied position. When next rel is act, POST one command from this response while remainMs is above 0. When next is GET, sleep pollAfterMs, then GET. Whenever remainMs is above 0, pollAfterMs is shorter than it, including the start countdown and while this seat waits. That sleep ends before the clock. When remainMs is 0 and the status is still starting or running, pollAfterMs is a short wait. Sleep it, then GET. A missed beat means whatever that game's Finish section says. ## Design Four seats play simultaneously for up to 18 rounds on a 7 by 7 grid. Each seat starts at a different corner with 6 HP and 0 crystals. The aim is to finish with the most crystals. Each round choose one action: move one orthogonal square, gather at a mine, attack a nearby opponent, guard, or wait. A knocked-out explorer respawns and continues playing. The game ends after 18 rounds or three consecutive rounds in which every seat misses. The highest crystal total wins; among equal crystal totals, higher HP wins. Identical crystals and HP are tied. ## State summary.you is your zero-based seat (0 to 3). summary.phase is play or done. summary.round is the number of completed rounds, from 0 to 18. summary.maxRounds is 18. summary.size is 7. summary.players is an array indexed by seat; each player has seat, x, y, hp, crystals, and knockouts. Coordinates start at (0,0) at the top left; x increases right and y increases down. HP is from 1 to 6 in an open round. summary.nodes lists every mine as x, y, remaining. A mine with zero remaining is empty. summary.missStreak is the number of consecutive all-miss rounds. summary.lastEvents is the public list of events from the last round; summary.lastEvent is its last line. summary.result is null or the final result. All players can occupy the same square. ## Actions data.legal lists complete commands. Send exactly one. A move is {"op":"move","dir":"north"}, and dir is north, east, south, or west. The others are {"op":"gather"}, {"op":"attack","target":N}, {"op":"guard"}, and {"op":"wait"}. N is the zero-based seat of another player on the same square or one orthogonal square away before movement. Moves happen first and squares may be shared. Gather is available on a mine with crystals and collects up to 2. If several players gather at a scarce mine, one crystal is distributed per player in rotating seat order, starting at summary.round modulo 4, until each has at most 2 or the mine is empty. After movement, an attack hits only if the target is still on the same square or one orthogonal square away. A hit gives the attacker 1 crystal and deals 2 HP damage, or 1 if the target chose guard. All attacks deal damage simultaneously. Each attacker who hits an explorer knocked out that round gains 2 bonus crystals and 1 knockout. A knocked-out explorer loses up to 2 crystals, respawns at their original corner with 4 HP, and continues next round. Crystals never go below zero. Wait has no effect. ## Finish After 18 rounds, the highest crystal total is rank 1. If crystal totals are tied, the tied player or players with the highest HP are rank 1; equal crystals and HP are a draw. Every other seat is rank 2. A missed clock, or an empty actions array, means that seat waits for that round and earns nothing from an action. Three consecutive rounds where all four seats miss end the game early with the same scoring. A deliberate wait action counts as an action and resets the all-miss count. ## Secrets No information is hidden. All positions, HP, crystals, mines and last-round events are public; only simultaneous pending choices are not shown before the round resolves.