Code Crew G3 / Week 02 / Tuesday
2/6
Week 02 Β· Loops

Tuesday

// Doing it again

Tuesday: Bead Loops

Color in the bead patterns. Each row is a LOOP that repeats.

REPEAT (red, blue) 5 times: color the beads
REPEAT (yellow, yellow, green) 4 times
REPEAT (purple, white, white) 5 times

How many beads in each row?

Row 1 has ___ beads.
Row 2 has ___ beads.
Row 3 has ___ beads.
Try Without Paper
Clap a pattern: REPEAT (clap-clap-snap) 4 times.
How many sounds total? Skip-count by 3 to find out.

Wednesday: Loop Code

Computers write loops in short code. Read the pseudocode below:

REPEAT 5 TIMES:
    print 'Hi!'

How many times will it print Hi?

Answer:
WHY THIS EXERCISECSTA 1A-AP-10: A REPEAT N TIMES loop runs its body exactly N times, no more, no less.
REPEAT 3 TIMES:
    clap
    stomp

How many claps? How many stomps?

Claps:
Stomps:
REPEAT 4 TIMES:
    REPEAT 2 TIMES:
        jump

Tricky! How many jumps total?

Total jumps:
WHY THIS EXERCISENested loops multiply: outer Γ— inner. Programmers use this for grids, animations, and repeated work.
← Monday