Reference
How the tinker lab works
Tinkering isn’t random button-mashing — it’s a small change and a careful guess. Once you can picture what each line stamps, you can read a one-line edit and SEE the new picture before you run it. Here’s the model. Open the tinker lab →
- A program stamps shapes at coordinates
Each `circle(x, y, size)` (or `square`, `triangle`) drops one shape at position (x, y) on a fixed square canvas. x goes right, y goes DOWN. Change x or y and the shape moves; change size and it grows or shrinks.
- A loop stamps many at once
`for i in 1...5 { circle(i * 20, 60, 9) }` runs five times, so it stamps five circles — at x = 20, 40, 60, 80, 100. The loop’s count is HOW MANY shapes; the coordinate that uses `i` is what spreads them out.
- Change one line — predict one difference
Change the loop count and you get more (or fewer) shapes. Change `circle` to `square` and the same spots hold squares. Change a fixed y into `i * 20` and a flat row tips into a diagonal. Each single edit makes ONE predictable difference — that is the whole game.
- An operator flips a trend
If a size grows with `s = s + 3`, the trail gets bigger; flip it to `s = s - 3` and the same trail shrinks instead. A single `+`/`−` decides which way a pattern runs.
- An if is a threshold
An `if i > 3 { y = 90 }` keeps shapes on a top line until i passes 3, then drops them to a bottom line. Move the threshold (`i > 4`) and the step slides over by one — small change, predictable shift.
- A nested loop makes a grid
A loop inside a loop stamps a grid: the outer loop makes rows, the inner loop makes the shapes along each row. Change the INNER count and the grid gets wider; change the OUTER count and it gets taller.
- random is steady here (a fixed seed)
`random(120)` picks a spot “at random”, but the lab uses a FIXED seed, so the same program always draws the same scatter. That is why you can still predict the diff: widen `random(60)` to `random(120)` and the same drops simply reach further down.
The stamp commands
circle(x, y, size)Stamp a circle centred at (x, y) with that size (its diameter).square(x, y, size)Stamp a square centred at (x, y), that many units on a side.triangle(x, y, size)Stamp an up-pointing triangle centred at (x, y), that big.color("blue")Set the colour of the shapes stamped after it (accent, red, blue, green, gold, purple). Decoration — the shape and place are what carry the meaning.random(n)Give back a whole number from 0 up to n − 1. Steady here (a fixed seed), so a scatter is the same every run.for i in 1...n { … }Repeat the body n times — the way one line stamps many shapes.
The trick to reading a tinker is to look ONLY at the one changed line and ask what it does differently: more shapes? a new shape? moved? bigger? a step that slid? Then picture just that difference. Read a tinker →