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
- The 3×3 floor tape grid from Lesson 2
- 6 large Arrow Cards (
↑ Step Forward, ↻ Turn Toward Door, ↺ Turn Toward Window)
- 1 paper Gold Star (
★) and 1 brown paper Mud Puddle (💧)
- Per pair (for Mystery 3): a 3-square paper strip (
[ Start ] [ Middle ] [ ★ ]), 3 paper [ ↑ ] cards, and 1 large wooden block or plush robot token (at least 5 cm wide; do not use coins or small erasers)
Vocabulary
- Bug: A mistake in our arrow cards that sends the Robot to the wrong square.
- Fix (Debug): Finding the wrong card and trading it for the right card so the Robot reaches the goal.
- Test: Having the Robot walk the cards from the beginning to check if our fix worked.
Lesson flow
1. Opening: The Mud-Puddle Mistake (6 min)
- Set up the 3×3 floor grid with:
- Robot (
R) at Bottom-Left (Row 1, Col 1), facing Up (↑)
- Gold Star (
★) at Middle-Left (Row 2, Col 1, 1 square straight ahead)
- Mud Puddle (
💧) at Top-Left (Row 3, Col 1, 2 squares straight ahead)
- Lay down two
↑ Step Forward cards: [ ↑ ] [ ↑ ].
- Act out the Robot:
- Card 1 (
↑): Step onto the Gold Star (Row 2, Col 1)—"Yay!"
- 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)!
- Ask: "Oh no! Why did the Robot step into the Mud Puddle? Which card was the bug?"
- 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:
- Mystery 1 — The Too-Short Recipe (Missing Card Bug):
- Goal (
★): Top-Left (Row 3, Col 1, 2 squares straight ahead from Start).
- Broken Cards on Rug:
[ ↑ ] (only 1 card!).
- Test: Robot takes 1 step to the middle square and stops one square short of the Star.
- How to Fix: Add one more
[ ↑ ] card at the end ([ ↑ ] [ ↑ ]) and re-test!
- Mystery 2 — The Wrong-Way Turn Bug:
- Robot (
R): Starts in the Bottom-Middle square (Row 1, Col 2), facing Up (↑).
- Goal (
★): Middle-Right square (Row 2, Col 3, toward the Door).
- Mud Puddle (
💧): Middle-Left square (Row 2, Col 1, toward the Window).
- Broken Cards on Rug:
[ ↑ ] [ ↺ Turn Toward Window ] [ ↑ ].
- Test: Robot steps up to the center square, turns toward the Window, and steps into the Mud Puddle!
- 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!
- Mystery 3 — Pair Tabletop Bug Fix (5 min):
- Each pair gets a small 3-square strip drawn on paper (
[ Start ] [ Middle ] [ ★ ]) and 3 paper arrow cards placed on the side: [ ↑ ] [ ↑ ] [ ↑ ].
- 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)
- Question 1: "When our Robot stepped in the Mud Puddle, was the Robot being naughty, or was it just following our cards?"
- Example good answer: The Robot was doing its job following the cards! The mistake (bug) was in the cards, not the Robot.
- Question 2: "Why do we always walk the path again from the Start square after we change a card?"
- Example good answer: To test our fix and make sure the new cards really reach the Gold Star!
4. Closing check (5 min)
- 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?
- What do computer scientists call a mistake in a list of instructions?
- 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
- The Robot stops 1 square too early (on the middle square). Fix it by adding one more
↑ Step Forward card ([ ↑ ] [ ↑ ]).
- A bug.
- Test it by having the Robot walk the arrow cards from the Start square.
Differentiation
- Extra support: Touch each arrow card with a pointer stick at the exact moment the Robot takes that step so students see the 1-to-1 match between the card on the floor and the Robot's footstep.
- Extra challenge: Give pairs a path with two bugs (wrong turn AND one missing forward step) to fix one bug at a time.
Safety
- Use only large wooden blocks, plush toys, or large paper cards (at least 5 cm across) as tabletop robot tokens; never use coins, beads, or small erasers that could be a choking hazard for 5-year-olds.
- Keep only one student walking inside the 3×3 floor tape grid at a time while classmates sit around the outside edge.
Teacher notes
- Building a warm debugging culture: Celebrate bugs with a cheerful class phrase like "Hooray, we found a bug! Now we can fix it!" so 5-year-olds view mistakes as normal, fixable puzzles rather than personal failures.