Rocket finds two loops in one program.
Both loops use the count box.
But the count box changes in the middle.
Raven asks, do both loops run the same?
Nova gets her logbook ready.
Repeat count times peeks in the count box.
The box tells the loop how many rounds.
set count to 3 set height to 1 repeat count times: change height by 2 stop say height change count by 1 repeat count times: flash lights
Count holds 3, so three rounds.
Height goes 1, 3, 5, 7.
Each round adds 2.
Build a loop that counts with a box.
Height starts at 1.
Nova must say 5.
Both loops say repeat count times.
But count changed in between.
So the loops ran different rounds!
set count to 3 set height to 1 repeat count times: change height by 2 stop say height change count by 1 repeat count times: flash lights
| after | the logbook says | true? |
|---|---|---|
| line 2 | height is 1 | ? |
| line 6 | height is 7 | ? |
| line 7 | count is 3 | ? |
| line 9 | count is 4 | ? |
Here are new sight words.
Look at each word. Say it. Spell it.
Upon: U-P-O-N.
Us: U-S.
River: R-I-V-E-R.
A box can count a loop.
The loop peeks when it starts.
Track every round in a logbook.
See you tomorrow, Crew!