Raven finds one more box in the auto-pilot.
Its name tag says steps.
Nova watches the steps box during a test flight.
Each time the ship moves, steps goes up by one.
The steps box is counting!
Rocket wants to learn how a box can count.
The ship moves one step at a time.
After each step, the box adds one.
Three steps, so the box holds 3.
Set steps to 0 starts the count.
Zero means nothing counted yet.
Change steps by 1 counts one more.
set steps to 0 move right change steps by 1 move right change steps by 1 say steps
Move, count. Move, count.
Only the change lines touch the box.
So Nova says 2.
Build a one-step counter.
Nova moves one step and says 1.
| after | steps holds | true? |
|---|---|---|
| line 1 | 0 | ? |
| line 2 | 1 | ? |
| line 3 | 1 | ? |
| line 4 | 2 | ? |
| line 5 | 2 | ? |
Counting ten steps takes so many lines.
Is there a faster way?
We find out tomorrow!
Set steps to 0 starts the count.
Change steps by 1 counts one more.
Great work, Crew!