Levels overview

Algorithy ships with 20 levels. Each level is one JSON file in src/levels/LevelN.json, registered statically in src/levels/index.ts (an import.meta.glob would be Vite-only, so imports are explicit). The level registry in domain/level.ts parses every file at module load, throws on invalid data or duplicate ids/slugs, and sorts by numeric slug.

The 20 levels at a glance

LevelTitle (en)GridTerrainPalette addsTeaches
1First Steps: Move Forward5x5default-sequencing, one locked move
2Turn Right5x5defaultturn-rightturning right
3Turn Left5x5defaultturn-leftturning left
4Into the Sand5x5amber-longer paths, new scenery
5Repeat: For7x5amberforrepetition with a fixed count
6Round and Round5x7amber-using for on a non-square map
7Decisions: If7x7forestifconditional turns, inside a for
8The Winding Path9x7forest-combining for and if
9Keep Going: While6x7forestwhilerepetition until the goal
10Mind the Gap: Holes (The Purple Path)9x9boss(hole trap)a hole trap changes the route
11Split Paths: Switch7x7stoneswitchbranching on the path ahead
12Hot Floor: Lava7x7stone(lava trap)a lava trap changes the route
13Rock Bottom9x9stone(hole trap)while + switch through a hole
14Frostbite: Ice7x5frost(ice)sliding on ice
15Slippery Slope7x7frost-planning around slides
16Deep Freeze9x9frost-longer icy routes
17Blue Ice9x9icy-blue-a map with no ground at all
18Frozen Maze9x9icy-blue-ice maze with decisions
19The Long Slide9x9icy-blue-a long ice slide onto the goal
20The Last Piece of Cheese (The Blue Path)9x9legend-the final chase: while + if

The palette is never hardcoded per level: each level's allowedActions list decides which blocks the palette offers, and the schema enforces that the defaults and the authored optimal solution only use those actions.

Title conventions

Level titles are player-facing content, not UI chrome, so they live in the level JSON as a locale-keyed record. Two rules keep them honest:

How levels teach

Registry details (domain/level.ts)

The authored optimum

Every level carries three numbers that describe its intended solution:

These three are not decoration. The test suite simulates every optimalSolution and asserts it wins with exactly the stated block and cycle counts, so editing a level without updating these numbers fails the gate. More on the cycle model in Cycles and optimization.

The exact JSON contract

Every field, its rules and defaults, is documented field by field on the Level schema page, with an annotated example.

Next: Level schema.