Free debugging game for kids ages 10–13: run short JavaScript-style programs, step through them with a variable watch table, find the buggy line and fix it.
How to play Bug Hunter
Each level gives your child three short programs. Every program has a clear goal (“print the sum of the numbers from 1 to 9”) and the output it should produce. Somewhere in the code a bug is hiding.
- Run it. Press Run to watch the program execute line by line, or Step to move one line at a time. The output panel shows what the program prints.
- Compare. Does the output match the expected output? If not, something is wrong.
- Trace. The watch table shows every variable after each step. Changed values light up, so it is easy to see when a total jumps the wrong way or a loop stops one round early.
- Tap the buggy line. A correct line just says “this line is fine.” The buggy line opens a short list of possible fixes.
- Pick the fix. Wrong options show what they would print, which teaches as much as the right answer. The correct fix is applied, the program runs again and the output turns green.
| Levels | Programs | Typical bugs |
|---|---|---|
| 1–4 | Variables and arithmetic | Wrong operator, missing brackets, a value calculated but never stored |
| 5–8 | Loops | Off-by-one (< vs <=), a counter that never changes, a loop that never ends |
| 9–12 | Loops with if | Wrong remainder test, > instead of >=, "i" in quotes instead of the variable |
| 13–16 | Lists and text | Reading past the end of a list, position vs value (i vs nums[i]) |
| 17–20 | Two bugs per program | Fix one, run again, and hunt down the second |
Numbers, words and lists are randomized, so programs change on every replay.
What your child learns
Reading code carefully. Writing code is only half of programming. Reading it, line by line, and knowing exactly what each line does is the other half. Bug Hunter makes that the whole game.
Tracing and prediction. Stepping through a loop while watching i and sum change is the best way to understand how loops work. Many children “know” loops but are surprised to see that i < 5 stops at 4. Watching it happen fixes the idea for good.
Classic bugs. The game focuses on mistakes programmers make every day: off-by-one errors, using a position instead of the value stored there, forgetting to store a result, mixing up + and *, or confusing a text string with a variable. Recognizing these patterns makes your child’s own code more reliable.
Scientific thinking. Debugging is a small experiment: form a hypothesis (“the loop stops too early”), test it with Step, and confirm it with the output. Wrong fixes show their result, so every guess produces evidence.
Calm persistence. Finding a bug can take a few tries. Because mistakes only cost stars, not the level, children learn to slow down and check rather than guess wildly.
Tips for parents
- Ask for a prediction. Before pressing Run, ask “What do you think this prints?” Then compare.
- Use Step on loops. Encourage your child to step through at least one loop per level and say the value of the counter out loud.
- Talk about the wrong fixes. When an option shows what it would print, ask why. Explaining a wrong answer is powerful learning.
- Celebrate the tricky ones. The two-bug levels are hard. Finishing them with any number of stars is an achievement.
Offline activities and variations
- Recipe bugs. Write a simple recipe or set of directions with one deliberate mistake and ask your child to find it.
- Paper trace tables. Take a short loop like “start at 1, double it 5 times” and fill in a table by hand: step, value. It is exactly what the watch table does.
- Swap roles. Let your child write a tiny program with a bug for you to find. Creating good bugs requires understanding the code deeply.
Common mistakes
- Tapping lines before running the program. The output is the clue, so always run first.
- Assuming the bug is on the line where the output is printed. Often the problem starts earlier.
- Forgetting that list positions start at 0.