Step 7: Debugging

Computers will follow whatever sequence of instructions they are given, even if those instructions are wrong. These coding mistakes are called bugs.

The chicken in Level 7 has already been programmed, but there are mistakes in the code. It won't reach the coin until the code its script is fixed.

> Open Level 7 in the levels tab.

> Click Play and select Level 7 to preview the game.

It looks like the chicken is making mistakes. We need to go through the script, figure out what's going wrong, and fix the blocks that are showing the wrong instructions.

> Right-click on the chicken and select Edit Script.

> Look at each block to figure out what it's telling the chicken to do.

Do you notice any mistakes? What will the chicken do if we broadcast an empty message?

> Think about the path the chicken needs to follow, and then look at the blocks.

> Fix the blocks so that they tell the chicken to the coin.

> When you are ready to test your code, click Play and select Level 7 from the game menu.

Once you've successfully debugged the Chicken, continue to the next step.

results matching ""

    No results matching ""