Claw Compiler

Drive a warehouse crane with code, restacking coloured crates under an instruction limit tight enough to demand recursion.

Was this fun?
How to play

Build a program from crane instructions (move left and right, grab, drop, and colour conditions) to rearrange the bins of crates into the target stack. The instruction limit is deliberately tight, so you'll lean on the Call command, which re-runs your whole program from the top; a condition that fails becomes the base case that stops the recursion. There are ten hand-built levels, from a single red crate to a six-crate tower, and eight of them cannot be solved without Call.

A worked example

Tower of Three: three red crates sit in bin 1 and must end up in bin 2, and you may use only six instructions. Spelled out longhand, each crate needs Grab, Right, Drop and Left, eleven instructions for three crates even after dropping the last Left. Six is not enough.

So write one trip and let it repeat: Grab, If-held red, Right, Drop, Left, Call. That is six instructions. The crane grabs a crate, checks that it is holding red, carries it over, sets it down, comes back and calls the whole program again. On the fourth call bin 1 is empty, Grab picks up nothing, the If-held red check fails, and the program stops. That failing check is the base case.

Change If-held red to If-held blue and the same six instructions clear the four-crate level and the six-crate tower too, because the routine never counts crates; it keeps going until there are none left. That is the point of recursion: the program describes one step and a stopping rule, and the input decides how many times it runs.

Controls
Tips & strategy
What you'll learn

Claw Compiler teaches recursion through a crate-stacking crane and a strict move budget, making a hard idea concrete.

Origins

Crane instructions — move left and right, grab, drop, and conditions on colour — are a minimal assembly language with a physical body attached.

Teaching programming through a small robot in a small world goes back to Karel the Robot, the beginners' language Richard Pattis introduced in a 1981 book and used in his courses at Stanford. Games took up the idea: Lightbot teaches loops and procedures by programming a robot through a maze, and Claw Compiler's closest ancestor is Cargo-Bot, a 2012 iPad puzzle in which you teach a robot to move crates. Two Lives Left built it with Rui Viana from his prototype in their iPad coding app Codea, and billed it as the first game programmed entirely on an iPad.

The task, rearranging bins of crates into a target stack, is sorting done by a machine that can hold exactly one thing at a time. That single-gripper limit is a lesson of its own. It is the same constraint a register imposes, and it is why real sorting needs somewhere to put things down — discovering that you need a spare bin is discovering the idea of temporary storage.

Because Call is always the last instruction, every program here is tail-recursive: the self-call is the final thing it does. Many language implementations turn a tail call into a plain jump back to the top, which is why the same program can be read either as recursion or as a loop. Seeing that the two are one idea is a large part of understanding recursion.

About Claw Compiler

Claw Compiler is an original, free browser game made for PlayPendium: a seven-instruction crane language, ten levels whose limits make recursion necessary rather than optional, a shared daily level and a practice mode that deals the others.

A free, original browser game on PlayPendium. No download, no install.

PlayPendium
About this game ↓
PlayPendium · About · Contact · Privacy · Terms · Cookies · Accessibility · Copyright · Browse all games · Classic arcade games · © 2026