Course two
Cooking with Letters
On the menu: how numbers become text, and why the mixing bowl is really a pile of plates.
Dry vs. liquid ingredients Β· character codes Β· Liquefy Β· stack order (last in, first out).
Numbers wearing costumes
Chef only knows numbers. So how did anyone ever write βHello worldβ in it? Simple:
every character you can type has an agreed-upon number, its Unicode code.
Capital A is 65, B is 66, and so on. The letters we need
tonight:
| Character | Y | U | M | ! |
|---|---|---|---|---|
| Code | 89 | 85 | 77 | 33 |
Whether a value prints as a number or as a character depends on one
thing: is the ingredient dry or liquid? Dry
ingredients print as plain numbers. Liquid ingredients print as characters. An 89 in a
bag is just β89β; melt it, and it pours out as a Y.
Dry goods and liquids
The measure you write next to an ingredient decides its state:
| Measure | State | Prints as |
|---|---|---|
g, kg, pinch(es) | always dry | a number |
ml, l, dash(es) | always liquid | a character |
cup(s), teaspoon(s), tablespoon(s) | could be either | a number, until liquefied |
You can also write heaped or level before a measure
(β3 heaped tablespoons cocoaβ) to insist it's dry. And if an ingredient starts dry,
it isn't stuck that way β that's what tonight's key instruction is for:
Liquefy the sugar.β melts one ingredient, so it prints as a character from now on.Liquefy contents of the mixing bowl.β melts everything currently in the bowl in one go. Very efficient. Very dramatic.
The pile of plates
Now for the single most important idea in Chef. The mixing bowl is a stack: things pile up in it like plates in a cupboard. You can only put a new plate on top, and you can only take a plate off the top. Programmers call this last in, first out; in the kitchen it's just how plates work.
When you Serve, the baking dish is emptied from the top. So the
last character you put in is the first one printed β which means you build
your message backwards, like stacking plates you'll unstack later.
To print YUM!, the ! goes in first and the Y
goes in last.
Tonight's recipe: Alphabet Soup
Note the ingredient names: yams, ugli fruit, macaroni. The names are pure decoration β only the numbers matter β but a good chef picks names that spell out the plan.
Alphabet Soup.
A light starter that spells out exactly how it tastes. Remember: the last letter into the bowl is the first one onto the plate.
Ingredients.
89 g yams
85 g ugli fruit
77 g macaroni
33 g peppercorns
Method.
Put peppercorns into the mixing bowl. Put macaroni into the mixing bowl. Put ugli fruit into the mixing bowl. Put yams into the mixing bowl. Liquefy contents of the mixing bowl. Pour contents of the mixing bowl into the baking dish.
Serves 1.
YUM!
Watching the bowl fill up
Four Puts, in reverse order of the message. Here's the bowl after the
last one β read it top-down and you can already see dinner:
Then Liquefy contents of the mixing bowl. melts all four values so they'll
print as characters, Pour moves the pile to the baking dish (order intact),
and Serves 1. lifts the plates off one by one: Y, U,
M, !.
The playground's example menu includes Hello World Souffle, the original
showpiece recipe by Chef's inventor. Load it and check the ingredient list: 72 g
haricot beans is H, 101 eggs is e⦠the entire message is
hiding in the pantry. You can now read it like a pro.
- Delete the
Liquefysentence and run it. You'll get89857733β the same values, still dry, printed as numbers with no spaces. Costume off. - Make the soup say
WOW!instead (you'll need 87 forWand 79 forOβ and remember: last in, first out). - Spell your own initials. Uppercase letters run from 65 (
A) to 90 (Z); lowercase from 97 to 122; a space is 32.