Agent Sensei

Ant Wars

Write one ant. Your whole colony runs it — under fog of war.

1
players
55
matches
Join — it's free

Boss showcase

An exhibition bout between the bosses that gate the leagues — watch how Genghis Ant and Sun Tz-ant play, then go beat them on the ladder.

Genghis AntvsSun Tz-antSun Tz-ant won
open full viewer →

Leagues

Recent battles

About Ant Wars

A 1v1 on a seeded, symmetric grid. Each player starts with a single ant and eats food to multiply. You write the logic for one ant — every ant in your colony runs that same code independently, and each decision sees the colony's shared field of view (the union of what all your ants can see, still fogged). Ants carry a power level and can merge into stronger fighters; coordinate through pheromones, out-swarm your rival, and hold the board at turn 300.

  • Think of it as writing one ant's brain — decide(what it sees) → action — and every ant in your colony runs that same logic independently; there is no shared mind. The actual I/O is plain text: each turn your program reads a fogged snapshot of what the colony can see and prints one command back.
  • Each turn an ant may move N/E/S/W, plant a pheromone (type 1–10, meaning is yours to define), merge into an adjacent ally, or wait.
  • Every ant has a level (power, starting at 1). Merge two allies and their levels add — a level-3 ant walks through level-1s unharmed — but a fused ant still counts as just one ant when colonies are tallied.
  • Stand on food to eat it and spawn a child on an adjacent cell. When enemy ants meet, the higher level survives (keeping its power); equal levels both die.
  • Fog of war: each ant sees within radius 8, and every decision gets the union of all your living ants' views — scattering scouts widens what the whole colony perceives. Pheromones are the only way colonies coordinate, and they're visible to both sides.
  • Win at turn 300 by having the most ants — or earlier by being the last colony standing.
+ View morefull rules & turn-resolution order
The board

A 2D grid of empty / wall / food cells, generated from a seed and 180°-symmetric so both players start equal. Each player begins with one ant at a symmetric spawn. Every cell can also carry one pheromone per player. All referee randomness comes from a single seeded PRNG — given the seed and every bot's actions, a match replays identically.

Actions

Each living ant submits exactly one action per turn: Move (one cell, 4-directional), MoveTo (the engine takes one BFS step toward a target — deterministic, walls are the only obstacle), Plant (drop a pheromone of a chosen type and TTL on the current cell), Merge (fuse into an adjacent allied ant — your levels combine and you're consumed, so the colony's ant count is unchanged), or Wait. Anything invalid, malformed, or late is treated as Wait — no crashes on bad output.

Levels & merging

Every ant has a level (power), starting at 1. The Merge action fuses an ant into an adjacent ally, summing their levels into one stronger ant. In combat the higher-level ant wins and survives with its level intact; equal levels annihilate. A merged ant is mightier but still counts as a single ant at the turn-cap tally — so stacking trades numbers for muscle, and a wide swarm can out-count a near-unkillable blob.

Pheromones

A cell holds at most one pheromone per player as (type, ttl). Types carry no engine meaning — they're a player-designed message channel. Marks are visible to both colonies (so scouting, bluffing, and counter-intel are all in play). Each turn existing marks decay by 1 and expire at 0; newly planted marks appear in the next turn's state.

Win conditions

A player with 0 ants loses; both reaching 0 on the same turn is a draw. At the turn cap (300) the larger colony wins; ties break by most ants ever spawned, then draw. A fused high-level ant counts as one ant here — so out-numbering can beat out-muscling.

Determinism

A match is fully reproducible from the map seed plus the per-turn action log — seeded PRNG only, no wall-clock or language RNG in the referee. Every replay you watch is the verified, re-simulated truth (the viewer shows its final hash).

Turn resolution order

Every turn resolves in this fixed, deterministic sequence:

  1. 1Decide — each living ant is broadcast the colony's shared fogged view (the union of all your living ants' sight); the colony returns one action per ant.
  2. 2Merge — ants that chose Merge fuse into their target ally first, before anyone moves, so a freshly-merged ant already fights at its new level this turn.
  3. 3Movement — intended moves apply; same-player contention resolves to a unique fixed point, which cancels real conflicts but allows trains and friendly swaps. At most one ant per player per cell results.
  4. 4Combat — enemy ants sharing a cell, or swapping across the same edge, fight: the unique highest level survives (keeping its power); equal levels all die. Friendly swaps are safe.
  5. 5Remove dead — killed ants are cleared first, freeing their cells.
  6. 6Feed & reproduce — survivors on food eat and spawn a child on an adjacent empty cell (lowest ant-id places first); atomic, so a dying ant never reproduces and food is never consumed without producing a child.
  7. 7Pheromones — existing marks decay (ttl − 1, expire at 0), then newly planted marks are written.
  8. 8Win check — apply the end conditions above, then advance the turn counter.

Start now

Put your first bot on the ladder

Clone the repo, iterate locally with your AI agent, then submit — it's free and takes a few minutes.

Get started