Skip to content
  1. Home
  2. Games
  3. Coding Games for Kids
  4. Bug Hunter

Bug Hunter · Coding game for kids

Bug Hunter

Run the program, or Step through it, and compare the printout with what it should print. Then tap the faulty line and pick the correct repair.

Ages 10+20 levels🔊 Sound🗣️ Voice
👶 Ages 10+ 🏁 20 levels 🔊 Sound effects 🗣️ Read aloud 📱 Works on tablets 🆓 Free, no sign-up

Free debugging puzzles for ages 10–13. Read small JavaScript-style programs, trace them with a variable table, spot the broken line and pick the fix.

The routine for each program

A level serves up three short programs. Each comes with a goal (“print the sum of the numbers from 1 to 9”) and the exact output it should give. Hidden inside the code is a bug.

  1. Run. The Run button plays the entire program. Step advances one line each press. Whatever the program prints appears in the output panel.
  2. Compare. A mismatch with the expected output means the code is wrong somewhere.
  3. Trace. The watch table lists all variables after every step. Fresh values glow, so you can watch a total jump the wrong way or a loop end a round early.
  4. Point at the culprit. Tapping a sound line gets the reply “this line is fine”. Tapping the faulty line opens a short menu of repairs.
  5. Pick a repair. Each bad choice displays what it would print, which can teach nearly as much as the good one. The right repair goes in, the program reruns, and the output turns green.
Levels Programs Typical bugs
1–4 Variables and arithmetic Wrong operator, missing brackets, a value computed 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, rerun, and track down the second

Numbers, words and lists change at random, so a replay offers fresh programs.

Skills at work

Programmers write code, but they also read it, and reading is the focus here: working through each line and knowing precisely what it does.

Following a loop while i and sum change reveals what loops actually do. Many young coders can describe loops yet are startled to learn that i < 5 ends at 4. One look at the table settles it.

The bugs on offer are everyday ones: off-by-one slips, grabbing a position instead of the value stored there, computing a result and not saving it, swapping + and *, or typing a variable name as plain text. Spotting such patterns makes a child’s own programs more reliable.

There is a hint of science too. A guess such as “the loop quits too early” can be tested with Step and confirmed by the output, and bad repairs still show results, so every attempt yields evidence.

Because mistakes cost stars rather than the level, children learn to slow down and verify instead of guessing.

Coaching tips

Ask your child to predict the printout before pressing Run, then compare. Encourage stepping through at least one loop per level while naming the counter’s value out loud. When a repair option shows its output, ask why that result is wrong, since explaining a mistake teaches a lot. The two-bug levels are demanding, so any finish deserves praise.

Offline versions

  • Faulty directions. Write a recipe or a route with one planted error and have your child find it.
  • Paper trace table. Try “start at 1, double five times” and fill a two-column table of step and value on paper, which is the watch table’s job.
  • Role swap. Invite your child to write a small program with a secret bug for you to find. Planting a good one takes deep understanding.

Typical slips

Children sometimes tap lines before running anything, yet the output is the main clue. They may also assume the bug sits where the answer is printed, though trouble often begins earlier. And list positions start at 0, which catches nearly everyone once.

Frequently asked questions

Does my child need to know how to code first?
Some background is useful but not required. Levels at the start involve nothing beyond variables and sums, for example `let total = apples * price;`, and each program explains its purpose in plain English. Code Quest players will find it familiar.
Why teach debugging when kids could simply write code?
Professional developers spend large parts of their day reading code and chasing faults. Debugging trains close reading, prediction and patience, and children carry those habits into their own projects.
What does the watch table do?
It tracks each variable and its present value. With Step, one line executes at a time and any value that just changed is highlighted, revealing the very moment a loop counter or total goes astray.
Is this actual JavaScript?
Close to it. The game uses a safe slice of JavaScript, executed by its own small interpreter. Variables, loops, if statements, lists and text behave as in the real language, so the skills transfer.
How does the game score stars?
Every level contains three programs. Wrong guesses, meaning a tap on a healthy line or a poor repair, reduce the rating. One slip or none earns three stars, and a finished level never earns fewer than one.

More games like Bug Hunter

All coding games for kids →