Code Crew G3 / Week 02 / Thursday
4/6
Week 02 Β· Loops

Thursday

// Doing it again

Spot the Bad Loop

One of these loops will run FOREVER and never stop. Circle which one.

(A)  REPEAT 10 TIMES:
         clap

(B)  REPEAT UNTIL it is sunny:
         smile
     (it has been sunny all morning)

(C)  REPEAT UNTIL pigs can fly:
         wait
The forever loop is:
WHY THIS EXERCISEInfinite loops are one of the most common bugs in programming. Always make sure your stopping condition can actually become true.
Try Without Paper
Make up a REPEAT UNTIL loop with someone in the car.
Example: 'REPEAT UNTIL we see a red car: I count houses.'

Friday: Mini-Project

Design a Pattern Bracelet

Pick a 3-color repeat. Write the loop. Color the beads to match.

Color 1: ____ Color 2: ____ Color 3: ____
REPEAT (color1, color2, color3) ___ times
Bracelet (color the beads)
← Wednesday