Thinking in Code
Math · Foundational · Lesson 2 of 9

Finding Bugs

Debugging like a detective

An interactive lesson with 7 steps, about 6 minutes: you predict, drag and solve, with instant feedback on every answer. It runs in your browser and needs JavaScript.

What you’ll learn

  • A bug is a gap between what a program says and what its author meant.
  • The line where things go wrong visibly is often not the bug.
  • Step through, compare with your intention, and fix one bug at a time.

Steps

  1. Bugs
  2. Fix the turn
  3. One square too far
  4. The crash isn’t the bug
  5. Where’s the bug?
  6. Two bugs
  7. One line out of place