Code Crew G2 / Week 02 / Thursday
4/6
Week 02 ยท Two Boxes, One Ship

Thursday

A two-column logbook
// Copy one box and lower another
โฑ about 15 min
Rocket the inventor holding his engineering tablet

Track two boxes!

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.

WARM-UP: LOWER THE BOX
  • Track the box.
  • Tap what Nova says.
set height to 7
lower height by 2
say height
?
set height to 2
change height by 3
lower height by 1
say height
?
A logbook with a height column and a speed column

A two-column logbook

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
Raven the explorer with her wrist computer

What do you notice?

Each line changes one box at most.

The other box copies down unchanged.

Nova says 2 at the end.

TRACK BOTH BOXES
  • Keep a logbook in your head.
  • Tap what Nova says.
set height to 3
set speed to height
change speed by 2
say speed
?
set height to 6
set speed to height
lower height by 2
say height
?
set speed to 1
set height to 5
set speed to height
lower speed by 2
say speed
?

Now build a program from a logbook.

Match the numbers, row by row.

MATCH THE LOGBOOK
  • Look at each row of the logbook.
  • Put the lines in that order.
1line 1
2line 2
3line 3
4line 4
Nova the drone-bird up close

Logbook check

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
afterheightspeedtrue?
line 12blank?
line 222?
line 355?
line 451?

Logbook champions!

A logbook tracks both boxes.

One row for every line.

Tomorrow: your own flights!

โ† Wednesday