Skip to content
CS 233 // Spimbot
Pages

Game rules

Each bot starts on its home base, a 3 by 3 block of tiles it owns, and grows its territory by driving out and back:

  1. When the bot drives off its own territory, it paints a trail behind it, one paint per tile.
  2. When it drives back onto its territory, the trail and every tile the trail encloses become its territory.
  3. It earns paint by solving puzzles.
A match on a map with wooden walls. Red owns a block of tiles beside its base in the upper left and has a trail running down from its base. Blue owns a block of tiles beside its base in the lower right. Below the map, each bot's panel shows its name, score and paint, and a bar along the bottom shows the time used.

Bot 0 is red and bot 1 is blue. Below the map, each bot's panel shows its name, its score and its paint. The time bar along the bottom fills as the match runs toward its cycle limit. It is green for the first half, orange until three quarters and red after that. A match without a cycle limit has no time bar.

A canceled bot goes back to its base. Driving into the map edge, a wall, the opponent's base or the opponent is a bonk: the bot stops.

In each cycle, every running bot executes one instruction, then the game moves the bots. A match ends at the first of these:

  • The match reaches its cycle limit: 10,000,000 cycles by default, set with --cycles.
  • No bot is running.
  • Under tournament rules, a bot crashes.

Scoring

#

A bot's score is the number of tiles it owns beyond its 9 home-base tiles, so scores start at 0. The higher score at the end wins, and equal scores are a tie. In a one-bot match, bot 0 wins once its score is above 0. Under tournament rules, a bot that crashes forfeits the match.

One or two bots

#

Bot 0 is the first file given. In a one-bot match, OTHER_X and OTHER_Y read -1.

A bot stops running when it exits or, under tournament rules, crashes. A stopped bot stops driving and gets no more interrupts or puzzles. It stays on the map, drawn faded, and still blocks the other bot. Its territory and trail stay too, and the other bot can still claim, cut off or smudge them.

Modes

#

The mode sets the paint each bot starts with. Pick it with --mode. The grade command picks the part's mode for you.

Mode Starting paint Used for
normal 20 Ordinary matches (the default)
test 65,535 Development runs with full paint
part1 65,535 Lab part 1
part2 20 Lab part 2
qualification 20 The qualification round
onboarding 20 The onboarding assignment