Robot's Revenge icon
Robot's Revenge
Help

Game Objective

You write a small looping program to control the robot. The puzzle is solved when the robot exits the board (moves beyond any edge). Crashing into a blocked square fails the run.

  • The robot always starts on the level start square facing North.
  • Programs are cyclic: when the pointer passes the last instruction it wraps to the first.
  • Every instruction consumes one execution step.
  • Each level enforces both a program length limit and an execution limit.

Board Legend

Empty Cell
Robot can move into this square.
Blocked Cell
Moving forward into this cell crashes.
Start Cell
Initial robot location for the level.
Robot
Current position and facing direction.

Robot Movement Graphics

Example sequence using two instructions. First L turns the robot left in place, then F moves it one square forward in its new facing.

Start (North)
L
After L (West)
F
After F (Moved)

S (Sense) does not move the robot. It checks the square ahead: if blocked, execute the very next instruction; if clear, skip one instruction.

Blocked ahead: execute next instruction.
Clear ahead: skip one instruction.

Instruction Set

Instruction Name Effect
F Forward Move one square forward. Exiting the board wins. Moving into a blocked square crashes.
L Turn Left Rotate 90 degrees counter-clockwise.
R Turn Right Rotate 90 degrees clockwise.
S Sense If ahead is blocked, move pointer +1. If ahead is clear/outside, move pointer +2.
J±n Jump Shift instruction pointer by signed offset.

Programs, Limits, and Levels

  • Program limit (plim): max number of instructions allowed for that level.
  • Execution limit (elim): max instructions executed before timeout.
  • Progression lock: level n+1 unlocks only after level n is verified as solved.
  • Player ID: generated once in local storage and reused for submissions/highscores.

The UI allows local simulation, but progression unlocks only after server verification via /api/submit.

Cloudflare API

POST /api/submit

Verify a program for a specific level and record the result.

{
  "player_id": "player-uuid-or-id",
  "level": 12,
  "program": "S F J-2 R F"
}

Typical success response:

{
  "ok": true,
  "player_id": "player-uuid-or-id",
  "level": 12,
  "solved": true,
  "accepted": true,
  "outcome": "escape",
  "steps": 87,
  "program_length": 5,
  "submitted_at": "2026-02-22T19:15:10.000Z",
  "solution_hash": "sha256..."
}

GET /api/highscores?limit=250

Returns one row per player, grouped by player ID, ranked by the highest passed level (result = "escape").

Level File Format

Levels are stored as query-string style text. Required fields are grid size and board payload; others use defaults.

?id=12&x=7&y=7&sx=3&sy=3&plim=10&elim=180&board=....... ..XX... ..X.... ...X... ....... ....... .......
Field Meaning
x, y Board width and height.
board Flattened grid. Empty: . or _. Blocked: X, x, #.
sx, sy Start position. Start direction is always North.
plim Program length limit for this level.
elim Execution step limit before timeout.
id Optional level identifier shown in metadata.

Download Level Files

Level files are publicly available from the deployed site under /levels/. Start with the manifest, then download individual .level files.

CLI example:

curl -fsSL https://YOUR_SITE/levels/manifest.json -o manifest.json
curl -fsSL https://YOUR_SITE/levels/1.level -o 1.level

Practical Tips

  • Use S to branch around obstacles instead of hard-coding long turn/step chains.
  • Use short loops with J-1 style jumps to reuse behavior.
  • If you time out, reduce wandering and remove non-essential turns.
  • If a level feels close, run step-by-step to inspect pointer and facing direction changes.