The Idea

This activity has been used in computer science classrooms for decades because it works so well. The child writes instructions for making a sandwich, then a parent follows those instructions exactly as written — no interpretation, no common sense applied, no filling in the gaps. The results are always funny and almost always educational.

When a child writes “put the peanut butter on the bread,” the parent picks up the entire jar and sets it on top of the bread. When they write “open the jar,” the parent stares at it, motionless, because the instruction didn’t say how.

Every failure is a debugging opportunity. Every rewrite gets them closer to instructions precise enough for a computer — or a very literal robot — to follow.

Before You Start

Have the child write their instructions on paper before you take out any food. They shouldn’t be able to adjust as they go. Once the instructions are written, the game begins.

Important: Tell the parent or partner in advance to be genuinely literal. Don’t “help.” If the instruction says “spread peanut butter,” ask “spread it where? With what?” Don’t move until the question is answered by the next instruction.

Step by Step

Step 1: Write the instructions

Give your child paper and pencil. Tell them: “You’re going to teach a robot to make a peanut butter sandwich. Robots follow instructions exactly and can’t guess what you mean. Write every step the robot needs to take.”

Let them write. Don’t give hints. Don’t correct them yet.

Step 2: Read the instructions aloud, then begin

Have the child read each instruction aloud. The parent follows it exactly as stated.

Common first instructions and their literal interpretations:

  • “Get the bread” → Parent holds up the entire loaf and waits
  • “Put peanut butter on the bread” → Parent puts the jar on top of the bread bag
  • “Open the peanut butter” → “Open how? I need more information.”
  • “Spread it” → “Spread what? Where? With what?”

Step 3: Debug

When an instruction fails (and it will), don’t keep going. Pause and ask: “What did you mean to say? How can we rewrite that instruction so it’s clearer?”

Have the child revise the instruction and try again. Keep a list of the revised instructions — this becomes their “updated algorithm.”

Step 4: Eat the sandwich

Eventually, the instructions will be precise enough that the sandwich gets made. Eat it together and celebrate.

Step 5: Talk about it

After the activity, ask:

  • “What was the hardest part about writing instructions?”
  • “What did the robot (me) do wrong? Was it actually wrong, or was it following your instructions exactly?”
  • “How is this like programming a computer?”
  • “Can you think of a time a computer did something silly because the instructions weren’t right?”

The AI Connection

This activity builds the most fundamental intuition in all of computer science: computers do exactly what you tell them, not what you meant. This is why programming is hard. This is why software has bugs. And this is why AI systems sometimes do strange or harmful things — not because they’re evil, but because the instructions (or the training data) didn’t account for every situation.

For older kids in this age range, you can extend the conversation: modern AI doesn’t follow explicit instructions — it learns instructions from millions of examples. But the fundamental problem remains: if the examples were incomplete or biased, the AI will do exactly what it learned, even if that’s not what we wanted.

Variations

Make it harder (ages 7–9): Try a more complex task — “make a glass of chocolate milk” or “put on a jacket” — and see how precise the instructions need to be.

Team mode: Have two children write instructions separately and compare them. Whose instructions are more precise? Why?

Loop the loop: Ask the child to write instructions for an action that repeats (like “stir the cocoa powder into the milk three times”). Talk about how computers handle repetition — loops.

Ready for more?

Explore all activities in the library, or find ones matched to your child's age.

All Activities → Browse by Age