A small first-person game about how compilers work, for players who have never studied them. You
are on the night shift at the Tapeworks, where orders written for people are turned into punched
tape for the Engine, a machine that only understands tiny steps like PUSH 3 and ADD. Tonight
every room that makes the tape is broken. Each room is one stage of a compiler, and each is a
puzzle you solve by doing that stage's job by hand.
Status: first build (local prototype). The Engine Hall and four rooms:
-
Room 1, the Sorting Floor (lexing). An order lies on the bench as one long piece of letters. Drop cutters between letters until every piece is a token: a name, a number or a sign. When two readings both work, the longest token wins (
>=stays whole, so doesarea2). -
Room 2, the Rigging Loft (parsing). The tokens hang along the bottom of a tall board. Hoist the signs in the order the maths really works, and each sign lifts the two things it combines. The wrong order builds a tree with the wrong value (
2 + 3 * 4comes out as 20, not 14). -
Room 3, the Casting Bay (code generation). Punch a tape on the desk from a finished tree, then run it. The Engine's stack piles up as crates beside the desk; it must end with exactly one number on it, the tree's value.
-
Room 4, the Trimming Shop (optimisation). A tape punched straight from a tree lies on the bench as cards. Fold fixed numbers together and remove steps that change nothing, down to a target length. A test bench runs the old and new tapes for several values of
xto show nothing changed. -
The Engine runs. With all four rooms working, the Order board shows each stage's work on tonight's order,
x * (2 + 3) + 0. Pull the lever beside the Engine and it runs the whole line.
Each room has a plaque that says what to do, and each solve ends with a card: what just happened, and why it matters. Phones work: there's a stick to walk, you drag to look, and a Use button.
Next rooms (not built): the Inspector (type checking: catching an order that adds a word to a number) and the Register Room (register allocation: four hands, too many crates).
A 2D concept of the same puzzles, used to test whether they teach, is in concept/index.html.
python3 tools/serve.py . 8798 # then open http://127.0.0.1:8798/
On Windows, tools\play-tapeworks.bat copies the game out of WSL and opens it in its own window.
Controls: W A S D to walk, mouse to look, E or click to use. At the punch desk, 1–9 press its keys from left to right. On a phone: stick, drag, Use.
Plain ES modules, no build step. The engine is Tangle's (engine/: Strata 0.7.0's web kit plus
Tangle's host.cpp), used unchanged; walking, geometry and audio are Tangle's and Inkling's too.
src/lang.js: the little language and its compiler (lexer, parser, code generator, the Engine's stack machine, the optimiser), the orders each room uses, and each room's rules.src/world.js: the hall and rooms, furniture, collision and lights.src/text.js: plaques and boards drawn to canvas textures, including the trees.src/game.js: the game: aiming, the rooms, the Order board, captions, cards, input.
npm test runs the compiler, puzzle and walking tests. node tools/shots.cjs [url] [outdir] [--phone]
plays every room headless, saves screenshots, and fails on a page error or a room that doesn't solve
(needs Playwright).
Code: MIT.




