Home / Hands-on activities / Debugging Treasure Hunt

Coding activity

Debugging Treasure Hunt

Parent acts out an instruction wrong on purpose. Child catches the mistake and corrects it.

Hands OnAbout 35 minutesScreen-freeParent help expected

Materials and setup

How this changes by age

Pre-K (ages 3–4)

Parent acts out an instruction wrong on purpose. Child catches the mistake and corrects it.

Difficulty 1 of 3

Steps

  1. Parent says: 'Time to get ready! I'm going to put on shoes BEFORE socks.' Then mimes putting shoes over bare feet.
  2. Child shouts what's wrong and corrects parent ('Socks first!').
  3. Try more: 'I'll pour milk into the upside-down cup.' 'I'll brush my teeth with my hairbrush.' 'I'll eat soup with a fork.'
  4. Each time, child finds the bug and says the right way.
  5. Switch roles — child does something silly on purpose, parent guesses the bug.
  6. Tell a grown-up one thing that surprised you.

Learning objectives

  • Watch a sequence carefully and notice an error
  • Verbalize a correction in their own words
  • Practice playful failure-recovery

Kindergarten (ages 5–6)

3 picture sequences with one card out of order. Find the wrong card.

Difficulty 2 of 3

Steps

  1. Parent draws or arranges 3 short picture sequences (4-5 cards each). Examples: planting a seed, brushing teeth, building a tower.
  2. In each sequence, place ONE card in the wrong position.
  3. Show child sequence 1. Child finds the card that's out of order and moves it.
  4. Repeat with sequences 2 and 3.
  5. Bonus: child arranges their own buggy sequence for parent to fix.
  6. Tell a grown-up one thing that surprised you.

Learning objectives

  • Identify out-of-order steps in a visual sequence
  • Reorder steps to restore correct sequence
  • Practice debugging without written language

Early elementary (ages 6–8)

5 short pseudocode puzzles, each with one bug. Solve all 5 in 10 minutes total.

Difficulty 2 of 3

Steps

  1. Parent prepares 5 short pseudocode snippets on paper, each 3-5 lines, each with exactly one bug.
  2. Bug types to use: (1) wrong loop count, (2) variable used before being set, (3) IF condition reversed, (4) missing increment in a loop, (5) two variables swapped.
  3. Set a 10-minute timer. Child works through all 5 snippets.
  4. For each, child circles the bug and writes the fix above it.
  5. After the timer, parent and child review each fix together. Celebrate every bug found, even partial.
  6. In one sentence, tell a parent or sibling what surprised you today.

Learning objectives

  • Recognize multiple distinct bug types in pseudocode
  • Work under time pressure without panicking
  • Articulate a fix for each bug in writing

Upper elementary (ages 8–10)

10 buggy snippets across many bug types. Time yourself: target 3 minutes per fix. Document every bug.

Difficulty 3 of 3

Steps

  1. Parent prepares 10 short pseudocode snippets on paper. Use a variety of bug types: off-by-one, infinite loop, missing condition, wrong variable, swapped operators (+ instead of -, < instead of >), uninitialized variable, return in wrong place, wrong loop bound, missing else, mismatched parentheses.
  2. Set a timer. Target: 3 minutes per snippet, 30 minutes total. Don't panic if one takes longer — move on and come back.
  3. For each bug, write one sentence in this format: 'Was: ___, should be: ___, because ___.'
  4. When the timer ends, count how many you fixed correctly.
  5. Review the ones you missed. For each miss, add a note to your debug log: 'I missed this because ___.'
  6. Try the same exercise next week with new snippets and beat your time.
  7. In one sentence, tell a parent or sibling what surprised you today.

Learning objectives

  • Diagnose 10+ distinct bug types in pseudocode
  • Work efficiently under a per-task time budget
  • Document each bug with a structured was/should-be/because explanation

Safety and evidence note

Read the full activity before beginning. An adult should supervise tools, heat, food, outdoor work, movement, and experiments as appropriate. Completion records that the activity was done; the child’s explanation, work sample, photo, or demonstration is stronger evidence of learning than a completion check alone.

Related coding activities

Browse all 575 activities · Explore course syllabi