Rocket and Raven study the auto-pilot together.
Two boxes change as the program runs.
It is hard to keep track in your head.
Raven opens her notebook.
She draws a logbook with two columns.
One column for height. One column for speed.
Each row is one line of the program.
Write what each box holds after it.
An empty box stays blank.
set height to 4 set speed to height lower height by 2 change speed by 1 say height
Each line changes one box at most.
The other box copies down unchanged.
Nova says 2 at the end.
Now build a program from a logbook.
Match the numbers, row by row.
Nova wrote a logbook.
Check every row. Is it right?
set height to 2 set speed to height change height by 3 lower speed by 1 say speed
| after | height | speed | true? |
|---|---|---|---|
| line 1 | 2 | blank | ? |
| line 2 | 2 | 2 | ? |
| line 3 | 5 | 5 | ? |
| line 4 | 5 | 1 | ? |
A logbook tracks both boxes.
One row for every line.
Tomorrow: your own flights!