← Back to course
Code Crew G2 / Week 05 / Thursday
4/6
Week 05 Β· Is It Over?

Thursday

A check in a loop
// A check asks a question about a box
⏱ about 15 min
Rocket the inventor holding his engineering tablet

Check every lap!

Rocket puts a check inside a loop.

Now Nova asks the question every lap.

On some laps the answer is false.

Then on one lap, it turns true!

Raven thinks about the auto-pilot drop.

The drop also comes on one lap, every time.

WARM-UP: IS IT EXACTLY?
  • Peek in the box.
  • Tap true or false.
set count to 3
if count is 3
?
set count to 3
if count over 3
?
A loop with a check inside it, under the repeat

A check in a loop

The check is under the repeat.

So Nova asks it every lap.

The then line is inside the loop too.

set count to 0
repeat 4 times:
change count by 1
if count over 2
then flash lights
A lap logbook where the check turns true on lap 3

The lap logbook

Laps 1 and 2: false. No flash.

Laps 3 and 4: true. Flash!

lapcountNova flashes?
lap 11?
lap 22?
lap 33?
lap 44?
WHAT DOES NOVA SAY?
  • Check every lap.
  • Tap the last number Nova says.
set count to 0
repeat 3 times:
change count by 1
if count under 3
then say count
?
set steps to 0
repeat 5 times:
change steps by 1
if steps is 2
then say steps
?
set count to 5
repeat 2 times:
lower count by 1
if count over 3
then say count
?

Build a flash on lap 3.

Count starts at 0.

Add one, then check.

BUILD A FLASH ON LAP 3
  • Lines under repeat run every lap.
  • Add one before the check.
1line 1
2line 2
3line 3
4line 4
5line 5
Raven the explorer with her wrist computer

What do you notice?

The check turns true on the same lap.

Every run, the very same lap.

Just like the drop. A new clue?

TRICKY ONES!
  • Check the name tags.
  • Tap the last number Nova says.
set height to 3
set steps to 0
repeat 4 times:
change steps by 1
if height over 2
then say steps
?
set count to 0
repeat 3 times:
if count is 2
then say count
change count by 1
?

Word Spot: something, seemed, next

Here are new sight words.

Look at each word. Say it. Spell it.

Something: S-O-M-E-T-H-I-N-G.

Seemed: S-E-E-M-E-D.

Next: N-E-X-T.

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?
?

You checked every lap!

A check in a loop runs every lap.

It can turn true on one lap.

Tomorrow: your own check flights!

← Wednesday