← Back to course
Code Crew G2 / Week 09 / Thursday
4/6
Week 09 Β· Read Ten Lines

Thursday

A job inside a loop
// Read a long program in chunks
⏱ about 15 min
Rocket the inventor holding his engineering tablet

A job inside a loop!

The auto-pilot has jobs, loops, and checks.

Today the crew reads a program like that.

A job runs again and again inside a loop.

Nova also has something to show the crew.

It is one of the auto-pilot jobs.

Raven cannot wait to see it.

WARM-UP: THEN OR OTHERWISE
  • Work out the box first.
  • Tap the line that runs.
the program
?
the program
?
The climb job: change height by 1, then fly up height

Meet the climb job

The climb job adds 1 to height.

Then it flies up height.

A nine line program in chunks: boxes, loop, check, say

A job inside a loop

set height to 1
set count to 3
repeat count times:
do climb
stop
if height over 3
then land
otherwise say safe
say height

The loop runs 3 rounds.

Climb runs once each round.

Height goes 2, then 3, then 4.

READ THE LONG PROGRAM
  • Read one chunk at a time.
  • Tap the answer.
the loop chunk
?
the climb job
lines 1 to 5
?
height holds 4
the check chunk
?

Build a flight with a job in a loop.

The wave job flashes the lights.

Wave two times, then land.

WAVE TWO TIMES, THEN LAND
  • Fill count, loop the job, stop.
  • Land one time, at the end.
1line 1
2line 2
3line 3
4line 4
5line 5
The check height job, folded shut, its lines hidden

A folded auto-pilot job

This is the check height job.

The drop happens inside it.

Nova keeps it folded for now.

We will open it in the bug hunt!

about the programtrue?
climb runs 3 times?
height ends at 3?
the last climb flies up 4?
Nova says safe?

Word Spot: hear, without, second

Here are new sight words.

Look at each word. Say it. Spell it.

Hear: H-E-A-R.

Without: W-I-T-H-O-U-T.

Second: S-E-C-O-N-D.

FIND THE WORD
  • Listen to the word.
  • Tap it.
Listen and find
?
Listen and find
?
Listen and find
?
Listen and find
?
FILL THE GAP
  • Listen to the sentence.
  • Tap the missing word.
Which word fits?
?
Which word fits?
?

Jobs in loops? You got it!

A do line inside a loop runs every round.

Long programs are just a few chunks.

Tomorrow: your own long flights!

← Wednesday