The Robot Sandwich Disaster

A free sample lesson from Thinking Like a Coder

The idea

A row of instruction cards being followed by a robot that takes each card 100% literally - jam still in the jar, bread still in the bag - until every card is exact.

What it actually is

Computers are literal. They do exactly what you say, and nothing more - they never guess what you mean. Tell a robot 'put the peanut butter on the bread', and it will put the whole jar, lid on, right on top of the loaf, still in its bag. It isn't being silly. It just doesn't know anything you didn't say. Being exact isn't fussy - it's the only way a computer understands you.

A worked example

Vague:  Put peanut butter on the bread.
Exact:  Open the jar. Push the knife into the peanut butter. Wipe the knife across one slice of bread.

The vague version has a hundred ways to go wrong and the robot will find all of them. The exact version says which thing, which tool, and what motion - so there's only one thing it can do.

Mistakes children actually make

Mistake 1: leaving out the boring steps, like opening the jar or taking the bread out of the bag. Humans skip those automatically; robots never do. Mistake 2: using words that need common sense, like 'a bit', 'nicely', or 'the normal way'. A robot has no idea what normal is.

Then they try it

In the app this lesson continues with the animated explanation, spoken aloud, and then the practice: Put the five cards in the order a totally literal robot would need to actually make a peanut butter sandwich. Remember: it can't open anything you didn't tell it to open. The editor runs your child’s real code and checks the result, with their coding buddy reacting to what they wrote.

Try it free