Look for the graphic aboveBug-B-Gone -- Learn to debug a program and circuit here!
In this project, students learn about debugging a program and circuit.
Students are presented with a game design and the code, where player 1 presses the green button, and player 2 presses the blue button. They will need to build the circuit and then follow instructions on how to identify the incorrect code using the print statement.
Piper Computer Kit
Two buttons (green, blue)
2 LEDs (green, blue)
8 Wires (various colors)
In this project, students will learn a key skill which is fixing code that someone else has written incorrectly. Students will view code that is written incorrectly and must use the print command with the console to understand what is wrong with the code before making the necessary changes. The print statement is used to view variable values on the console. Other key skills in this project are events, conditionals, variables and functions.

This is the code for a two player game. First, build your controllers.
Now press Start. The first player to press their button 3 times should win and their LED should light up. Does it work for both buttons?
Player One always wins. Why is that? Lets add a Print block to find out. Attach the String block and type Player One.
Add another Print block. This time attach the playerOneScore variable.
Drag these two Print statements into the pin 36 event block.
Select the Console Tab and press Start. When you press the green button you should see the player one variable count up.
Player one looks good, now let's try player two. Create Print statements for player two.
Now drag the new Print statements into the pin 26 event block.
Now press Start with the console on. What happens when you press the blue button?
Look closely at the code in the pin 26 event block. Is something wrong? Try to fix it.