Week 23. Repetition and loops
- ◇ Trace a repeat-N-times loop and predict its final value.
- ◇ Explain how a repeat-until loop knows when to stop.
- ◇ Recognise the forever loop inside every robot controller.
- 1Repeat N timesA robot must draw a square. You could write eight instructions. Could you write it in three?25 min
- 2Repeat until: loops that decide when to stopYou don't know how many spoons of sugar a cup of tea needs until you taste it. How does a machine 'taste'?25 min
- 3The forever loop inside every robotInfinite loops are a bug, right? So why does every traffic light controller run one on purpose?25 min