RoboZZle

A programming puzzle with no typing. You give a little robot a few instructions, it runs them, and it has to collect every star on the board without falling off. This is a JavaScript remake of the game, plus a level editor and a library of nearly ten thousand levels made by players of the original.

20easy classics to start
12starter levels
9,921player-made levels
152verified solutions
Solution, F1:↑↱F1— forward, turn right if on red, repeat

How a level works

The board is a grid of red, green and blue tiles floating in empty space. The robot starts on one tile, facing one way. You fill a few slots in up to five functions, F1 to F5, then press Run. The program starts at F1.

↑↰↱

Move and turn

Forward moves one tile. Left and right turn on the spot. Stepping onto empty space loses the level.

F1F2

Call a function

Calling a function runs its slots, then comes back. A function that calls itself is a loop, and the slot count is what makes levels hard.

↱↑F2

Colour conditions

Any instruction can be coloured. A coloured instruction only runs when the robot stands on a tile of that colour; otherwise it is skipped.

Paint

Some levels allow painting the current tile. Paint is memory you leave on the board: a mark to recognise later.

You win the moment the last star is collected. You lose by driving off the board or running out of instructions. A run that passes 200,000 steps is stopped as an endless loop.

The trick that makes it deep: the stack

When a function calls another, the rest of the caller waits on a stack and runs later, last in, first out. A conditional call only stacks anything when its colour matches. So the robot can count tiles as it drives, then pay the count back later, without any variables.

Stronger players use this to explore trees and come back, to double a count, or to replay a path in reverse. The Stack Memory Tutorial on the RoboZZle Solutions blog is a good introduction. The game shows the live call stack under the board so you can watch it grow and unwind.

// level 11, "Count and turn"
F1: F2 · right · F3
F2: forward · blue? F2 · red? left · forward
F3: forward · F3
// each blue tile stacks one "forward";
// on red the robot turns and the stack replays,
// so it goes north exactly as far as it went east

What is in this folder

play.htmlThe game: board, program slots, run, step and instant run, a level editor, and the library browser. One self-contained file, no build step.
levels.jsonThe level database (about 4.4 MB), loaded only when you open the library.
tools/gen.py, gen2.pyBuild the 12 starter levels and check each one against a reference solution in a small Python simulator.
tools/convert.pyConverts the robozzle.com level archive into the game's format and replays the solver's solutions to keep only those that win.
tools/build_db.pyAdds write-ups, videos, hints and tags, and writes levels.json. See tools/README.md for how to rebuild it.

In the game

The library filters by featured levels, levels with hints or walkthroughs, levels with a solution, stack puzzles, paint puzzles and the ones you have solved, and sorts by likes, solvers or difficulty. A library level shows its author's note, a link to the original and its comments, any write-ups and videos, hints, and a hidden solution you can load. The editor paints tiles, places stars and the robot, sets slot counts, and saves levels in your browser or shares them as JSON. Progress and programs are kept in your browser only.

Adding your own levels

Draw one in the editor, or write it by hand. Paste a level, or a list of levels, into the editor's JSON box and press Import. To make a level permanent for everyone, add it to the BUILTIN list near the top of the script in play.html.

  • . empty space · r g b coloured tiles · R G B the same tiles holding a star
  • robot.d facing: 0 east, 1 south, 2 west, 3 north
  • funcs slots in F1, F2… (up to five functions)
  • paint allowed paint colours: 1 red + 2 green + 4 blue
{
 "name": "Red means turn",
 "board": [
  "................",
  "................",
  "..bbbbBbbbr.....",
  "..........b.....",
  "..........b.....",
  "..........b.....",
  "..........B.....",
  "..........b.....",
  "..........b.....",
  "..........B.....",
  "................",
  "................"
 ],
 "robot": {"x": 2, "y": 2, "d": 0},
 "funcs": [3],
 "paint": 0
}

Where the levels come from

RoboZZle was created by Igor Ostrovsky; the original is at robozzle.com. Every library level was designed by a player there. 1,785 authors contributed levels dated from December 2008 to May 2023. This remake reuses the levels with credit and a link back to each original.

Level boards. The RoboZZle level archive, plus 95 levels from the puzzle files in arnfaldur/RobozzleSolver.

Solutions. 152 found by that automatic solver, each replayed in this game's engine and kept only if it wins.

Write-ups and videos. The RoboZZle Solutions blog, robozzlesolutions.blogspot.com and Nnadozie/robozzleExercises; 56 levels have at least one.

Hints. A few short hints written from those pages, each linked to its source. The comments on each robozzle.com puzzle page hold many more.