Session 1.3

Debug It! Fix the Problems

Help! Can you debug these five scratch programs?

In this activity, you will investigate what is going awry and find a solution for each of the five Debug It! challenges.

When the green flag is clicked, both Gobo and Scratch Cat should start dancing.

But only Scratch Cat starts dancing!

In this project, when the green flag is clicked, the Scratch Cat should start on the left side of the stage, say something about being on the left side, glide to the right side of the stage, and say something about on the right side.

The Scratch Cat should do a flip when the space key is pressed.

But when the space key is pressed, nothing happens!

How do we fix the program?

In this project, the Scratch Cat should pace back and forth across the stage, when the Scratch Cat is clicked.

But the Scratch Cat is flipping out -- and is walking upside down!

How do we fix the program?

In this project, when the green flag is clicked, the Scratch Cat should say "Meow, meow, meow!" in a speech bubble and as a sound.

But the speech bubble happens before the sound -- and the Scratch Cat only makes one "Meow" sound!

How do we fix the program?

Feeling Stuck?

  • Make a list of possible bugs in the program.
  • Keep track of your work! This can be a useful reminder of what you have already tried and point you toward what to try next.
  • Share and compare your problem finding and problem solving approaches with a neighbor until you find something that works for you!

Finished?

  • Discuss your testing and debugging practices with a partner. Make note of the similarities and differences in your strategies.
  • Add code commentary by right clicking on blocks in your scripts. This can help others understand different parts of your program!
  • Help a neighbor!