Foundations
Repeating
Count repeated work, test before or after it, and check what can make a loop finish.
Begin — Unit 01 →What this is
A loop does a piece of work over and over, and you write the work once.
We use three loop forms in this module. By the end of the second one you will have turned the guessing game from Decisions into something you can play.
Who it’s for
You will use stored values and yes/no comparisons. We recall the question as we use it. Decisions offers more practice; prior attendance is not required. BASIC and assembly remain independent entry points.
The shape
- Doing it again — the counted loop, and a counter you can use as it goes.
- Until you get it — test after the work, use
RANDOM, and follow a small game-loop model. - Checking before you start — the loop that asks first, so the work can happen no times at all.
Next comes Structure, where a box holds many values and a job gets a name.