Coding activity
Debugging Treasure Hunt
Parent acts out an instruction wrong on purpose. Child catches the mistake and corrects it.
Materials and setup
- paper with pre-written buggy snippets
- pencil
- timer
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.
Steps
- Parent says: 'Time to get ready! I'm going to put on shoes BEFORE socks.' Then mimes putting shoes over bare feet.
- Child shouts what's wrong and corrects parent ('Socks first!').
- 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.'
- Each time, child finds the bug and says the right way.
- Switch roles — child does something silly on purpose, parent guesses the bug.
- 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.
Steps
- Parent draws or arranges 3 short picture sequences (4-5 cards each). Examples: planting a seed, brushing teeth, building a tower.
- In each sequence, place ONE card in the wrong position.
- Show child sequence 1. Child finds the card that's out of order and moves it.
- Repeat with sequences 2 and 3.
- Bonus: child arranges their own buggy sequence for parent to fix.
- 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.
Steps
- Parent prepares 5 short pseudocode snippets on paper, each 3-5 lines, each with exactly one bug.
- 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.
- Set a 10-minute timer. Child works through all 5 snippets.
- For each, child circles the bug and writes the fix above it.
- After the timer, parent and child review each fix together. Celebrate every bug found, even partial.
- 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.
Steps
- 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.
- Set a timer. Target: 3 minutes per snippet, 30 minutes total. Don't panic if one takes longer — move on and come back.
- For each bug, write one sentence in this format: 'Was: ___, should be: ___, because ___.'
- When the timer ends, count how many you fixed correctly.
- Review the ones you missed. For each miss, add a note to your debug log: 'I missed this because ___.'
- Try the same exercise next week with new snippets and beat your time.
- 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
AI Explorers
Train a pretend 'robot brain'! Show it 5 cat pictures and 5 dog pictures, then test if it can guess a new one.
Algorithm Art
Follow step-by-step drawing instructions to create a picture. The instructions are your algorithm! Each step adds one shape or line.
API Restaurant
Play restaurant! The customer tells the waiter what they want, the waiter tells the kitchen, and the kitchen makes it. The waiter is the messenger — just like how computers talk to each other!
App Design Workshop
Design your dream app! Draw what you'd see on a phone screen. What would your app do? What buttons would it have?