Rocket wants to clap five times. He writes a loop and runs it. He claps and claps and claps! "Why won't I stop?" he says with a grin.
Raven reads the code. "What do you notice? There are two REPEAT lines."
Nova says, "Loops and boxes can both have bugs. Check every number carefully." Let's help them fix the loop bugs and the box bugs.
These loops have bugs. Read carefully and fix each one.
(A) Goal: clap 5 times
REPEAT 5 TIMES:
REPEAT 5 TIMES:
clap (B) Goal: stop when bowl is empty
REPEAT UNTIL the bowl is full:
eat one bite What's wrong with this score keeper?
score = 0 (after 3 goals) score = 1 score = 1 score = 1
And this? Should be a count of jumps.
jumps = 0 (every jump) jumps = jumps - 1