Log inStart free
LESSON 19.05 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Procedural generators and task grammars

Watch one seed and a few rules build a maze task.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 19.05 · GENERATORSEED 1 · 5×5 · 2 DOORS · L 19
01
Stage 1 of 6 · Seed to level
A procedural generator G turns parameters θ and a seed into one level. Seed 1 gives a 5×5 maze with 2 doors.
Explain it simply

A generator is a recipe with knobs. The knobs, called parameters, set the maze size and the rules. The seed is a number that picks one level. The same seed always gives the same level.

Left: a 5 by 5 maze with its start, its exit and 2 doors and their keys. Right: the parameters and seed 1 feed the generator G, which fills the task card.

startparameters, seed, keys, budgetdoors, stallsexit, plan, resultswalls
the levelgenerator GS1212Eparameters θsize 5×5door limit 2stall from 0, 0.1, 0.2budget factor 1.25, 1.5, 2seeds = 1level (the filled template)maze 5×5, start row 4, column 3goal key 1 → door 1 → key 2 → door 2 → exitstall 0.1budget 38 steps for L = 19 movesGthe levelgenerator GS1212Eparameters θsize 5×5door limit 2stall from 0, 0.1, 0.2budget factor 1.25, 1.5, 2seeds = 1level (the filled template)maze 5×5, start row 4, column 3goal key 1 → door 1 → key 2 → door 2 → exitstall 0.1budget 38 steps for L = 19 movesG
Toy: real maze carving, grammar and stalls, seeds 1–200
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
level=G(θ, s)\sy{lvl}{out}{\text{level}} = G(\sy{th}{param}{\theta},\ \sy{s}{param}{s})
G(θ={5×5, d≤2}, s=1)→L=19G(\theta = \{5{\times}5,\ d \le 2\},\ s = 1) \to L = 19

The generator maps the parameters and a seed to one level.

Common mix-ups

MYTHA new seed gives a new kind of task.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01A 7×7 maze has 49 cells. How many walls does the carver open?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.