How-To: Debug Your Code
Debugging is how programmers make sure that the program does what it’s supposed to do. The step button lets the program run one line at a time. This is very handy because we get to see how the code on each line works. We can track the variable in the program such as the ‘bounce’ variable that has the value of 4 at line 3. To look at the variable at line 14, select line 14. Notice that the ‘move’ variable has the value of 1. We can switch back by selecting line 3 to look at the state of the program on line 3. A program breakpoint can be set on a given line before continuing the program until it reaches that line. Unset the breakpoint and let the program continue until it finishes.