-
All computer scientists, no matter how
experienced they are, run into errors or
-
something they need to fix.
-
This is where debugging comes in. Debugging is just a
-
word that means finding and fixing errors in
a program and the first step towards fixing
-
errors is to find them. Most puzzles have
a step button below the play space that
-
you can use to hunt for problems. If your
program doesn't work, press the "step"
-
button, and see what happens. Does the
character take action in the right way?
-
If everything looks good with the first
block of code, press the step button
-
again. How does everything look? Is it
still running right? Keep going through
-
your code, line by line, until you find
the first place where things go wrong.
-
What happened? What was supposed to
happen?
-
What does that tell you? In this puzzle I get
to the last line of code and don't reach
-
the goal. What happened? I got to the end
of my code without solving the puzzle.
-
What was supposed to happen?
I need to go forward one more step.
-
What does that tell me? It tells me I need to drag
out one more of these blocks and attach
-
it to the end, before I click run. Tada! That's how you debug a program.