Code Crew G1 / Week 04 / Wednesday
3/6
Week 04 · Bug Hunt in the Lines

Wednesday

The missing line
// Find the bug, fix the line
⏱ about 15 min
Rocket the inventor holding his engineering tablet

A line is missing!

A line vanished from the program.

Now there is a gap.

The plan knows what belongs.

WARM-UP: FIXED OR NOT?
  • Remember the plan.
  • Tap the fixed program.
the plan
?
the plan
?
A program with an empty gap where line two should be

The program has a hole

Line two is empty.

The plan: right, up, up.

What belongs in the gap?

Raven the explorer with her wrist computer

What do you notice?

Count the moves in the plan.

Count the lines in the program.

Numbers different? Line missing!

Nova the drone-bird hovering with glowing eyes

Nova hovers at the gap

Nova cannot invent lines.

No line, no move!

You fill the gap.

FILL THE GAP
  • Say the plan.
  • Tap the missing line.
move right
missing line
move up
?
missing line
move right
move up
?
move up
move right
missing line
?
move right
missing line
move right
?
move up
missing line
move right
move right
?

Five gaps, five discoveries!

Now rebuild a whole program.

Missing line and all.

REBUILD WITH THE MISSING LINE
  • The plan: right, up, up, stop.
  • Build all four lines.
1line 1
2line 2
3line 3
4line 4
TRICKY ONES!
  • Count the plan carefully.
  • Tap the missing line.
missing line
move right
move up
?
move right
move right
missing line
move up
?

Every gap is filled!

Count the plan. Count the lines.

A gap means a missing line.

The plan fills every hole.

← Tuesday