The Recipe Follower
We have doors that decide, drawers that remember, and a steady heartbeat to keep time. Now we put them all on one workbench—and watch a fixed pile of switches become a machine that can do anything.
Every contraption we built so far had one job wired permanently into its bones. If you wanted a machine that counted, you soldered together a counting circuit. If you wanted a machine that blinked a lighthouse pattern, you built a completely different circuit. Changing the task meant grabbing a screwdriver and rewiring the workshop.
Then, in the middle of the last century, engineers stumbled upon an idea so simple and so astonishing that it reshaped the entire modern world: stop building a different machine for every task. Build one tireless chef who reads index cards.
Inside the Chef's Tiny Kitchen
Picture a remarkably small, tidy kitchen with only four things in it—and notice that we already built every single one of them in earlier chapters:
- A shelf of numbered index cards—our memory drawers from Chapter 4, except now each drawer holds a short instruction instead of just a count.
- A pointing finger—a tiny memory slot that remembers the number of whichever card the chef should read next.
- A single pebble bowl and two spare drawers—a workbench where the chef can drop pebbles in, scoop pebbles out, or tuck a count away for later.
- Our metronome from Chapter 5, tapping out a steady, unhurried beat.
On every turn, the chef does the exact same three-beat dance, without ever improvising or getting bored. On Beat 1 (Fetch), the chef looks where the pointing finger is resting and lifts that card off the shelf. On Beat 2 (Read), the chef decodes what the card is asking. On Beat 3 (Act & Slide), the chef carries out the instruction—dropping pebbles, scooping them out, or copying them to a drawer—and slides the pointing finger down to the next card.
Click Next Beat step by step to watch a single index card travel from the shelf to the chef's hands and drop pebbles into the bowl.
One Fixed Machine, Endless Recipes
At first, this might seem almost disappointingly simple. Dropping pebbles and sliding a finger down a list? How could a kitchen that tiny ever do anything clever?
Here is the secret ingredient: a card is allowed to move the pointing finger itself.
Imagine Card 4 says, "Jump back to Card 1." Suddenly, a tiny stack of six cards can run for a thousand beats without ever running out of paper! Now imagine Card 3 says, "If the bowl has 10 pebbles, jump to Card 5." For the first time, the machine can look at what is in its own bowl and choose a different path based on what it sees.
Notice the miracle that just happened. The workbench below never rewires a single switch. The bowl stays the same. The drawers stay the same. Yet simply by swapping the six index cards on the shelf, the exact same machine can count by twos, fill and empty a bucket in a steady rhythm, or double its pebbles over and over again.
Pick a recipe below, then tap Step 1 Beat or Run to watch the exact same machine perform three completely different jobs.
Before this chapter, changing what a machine did meant changing the machine itself. Now, the machine stays frozen in metal and glass forever—and ideas written on cards bring it to life.
That completes Part II! Starting from a single flashlight in the dark, we have built decision doors, memory shelves, a self-buzzing heartbeat, and now a genuine recipe-following computer. Yet writing out tiny pebble-moving cards one by one is slow and tedious for human beings. In Part III, we will discover how people taught these patient machines to understand human-friendly words—and how to organize millions of drawers without losing a single thing.
What You Just Built
- The 3-Beat Dance: Fetch the pointed card, Read its rule, Act on the workbench and slide the finger onward.
- Conditional jumps—cards that peek at the pebble bowl and move the pointing finger to another card, allowing loops and decisions.
- A complete, working Recipe Machine that can switch from counting to filling to doubling simply by swapping its index cards.