Lesson 3: Oops, Wrong Square! — Fixing a Bug on the Rug

Learning objective

Students will watch a Robot follow a broken arrow-card path, point to the exact card that caused the Robot to miss the Gold Star or step in a Mud Puddle (a bug), and fix the path.

Materials

Vocabulary

Lesson flow

1. Opening: The Mud-Puddle Mistake (6 min)

  1. Set up the 3×3 floor grid with:
  2. Robot (R) at Bottom-Left (Row 1, Col 1), facing Up (↑)
  3. Gold Star (★) at Middle-Left (Row 2, Col 1, 1 square straight ahead)
  4. Mud Puddle (💧) at Top-Left (Row 3, Col 1, 2 squares straight ahead)
  5. Lay down two ↑ Step Forward cards: [ ↑ ] [ ↑ ].
  6. Act out the Robot:
  7. Card 1 (↑): Step onto the Gold Star (Row 2, Col 1)—"Yay!"
  8. Card 2 (↑): "Wait, there is still another card! Robots must follow every card!" Step forward off the Star and SPLASH! right into the Mud Puddle (Row 3, Col 1)!
  9. Ask: "Oh no! Why did the Robot step into the Mud Puddle? Which card was the bug?"
  10. Students point to the extra second ↑ card! Take away the second ↑ card and test again—now the Robot stops safely on the Gold Star.

2. Main activity: Three Bug-Fix Mysteries (15 min)

Invite student Bug Detectives to solve three broken programs on the rug:

  1. Mystery 1 — The Too-Short Recipe (Missing Card Bug):
  2. Goal (★): Top-Left (Row 3, Col 1, 2 squares straight ahead from Start).
  3. Broken Cards on Rug: [ ↑ ] (only 1 card!).
  4. Test: Robot takes 1 step to the middle square and stops one square short of the Star.
  5. How to Fix: Add one more [ ↑ ] card at the end ([ ↑ ] [ ↑ ]) and re-test!
  6. Mystery 2 — The Wrong-Way Turn Bug:
  7. Robot (R): Starts in the Bottom-Middle square (Row 1, Col 2), facing Up (↑).
  8. Goal (★): Middle-Right square (Row 2, Col 3, toward the Door).
  9. Mud Puddle (💧): Middle-Left square (Row 2, Col 1, toward the Window).
  10. Broken Cards on Rug: [ ↑ ] [ ↺ Turn Toward Window ] [ ↑ ].
  11. Test: Robot steps up to the center square, turns toward the Window, and steps into the Mud Puddle!
  12. How to Fix: Which card was the bug? Card 2 (↺ Turn Toward Window)! Swap Card 2 for [ ↻ Turn Toward Door ], then re-test from the start to watch the Robot land on the Gold Star!
  13. Mystery 3 — Pair Tabletop Bug Fix (5 min):
  14. Each pair gets a small 3-square strip drawn on paper ([ Start ] [ Middle ] [ ★ ]) and 3 paper arrow cards placed on the side: [ ↑ ] [ ↑ ] [ ↑ ].
  15. Partners slide their large wooden block or plush robot token along the 3 squares, see that 3 steps goes off the end of the paper strip, and remove 1 ↑ card so their token lands right on [ ★ ].

3. Discussion questions (4 min)

4. Closing check (5 min)

  1. A Robot needs to move 2 squares forward to reach the Gold Star ([ Start ] → [ Square ] → [ ★ ]), but the programmer only put down 1 ↑ card. Where will the Robot stop, and how do you fix the bug?
  2. What do computer scientists call a mistake in a list of instructions?
  3. After you fix a bug in your arrow cards, what should you do next to be sure your fix works?

Worked answers for closing check

  1. The Robot stops 1 square too early (on the middle square). Fix it by adding one more ↑ Step Forward card ([ ↑ ] [ ↑ ]).
  2. A bug.
  3. Test it by having the Robot walk the arrow cards from the Start square.

Differentiation

Safety

Teacher notes