Session 4.5
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.
In this project, the "Inventory" list should be updated every time Scratch Cat picks up a new item. But Scratch Cat can only pick up the laptop. How do we fix the program?
In this project, the Scratch Cat is supposed to start the game with no points. But when the green flag is clicked it starts with -5, and then get -5 for each pink gobo touched. How do we fix the program?
In this project, Scratch Cat is thinking of a number between 1 and 10. But something is wrong with the guess checking -- it doesn't work consistently. How do we fix the program?
In this project, the "# of hits" display should increase by 1 every time the Scratch Cat is hit by a tennis ball. But the "# of hits" increases by more than 1 when Scratch Cat is hit. How do we fix the program?
In this project, Scratch Cat is navigating a maze to get to the yellow rectangle. But Scratch Cat can walk through walls. 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!