A REPEAT…UNTIL loop with two ways to stop
A REPEAT loop whose UNTIL condition uses OR stops as soon as either part becomes TRUE, so the loop has two ways to end: a correct guess or running out of tries.
Understanding A REPEAT…UNTIL loop with two ways to stop in ACARA Digital Technologies Years 9–10
What it does: The OR in the UNTIL line gives two exits, and Tries is updated in the loop so the second exit can happen. The loop only ends when both range checks are TRUE, so a mark outside 0 to 100 is asked for again. Mark <= 100 is FALSE, so AND makes the whole condition FALSE and the loop repeats.
Common mistakes: Tries must start at 0. Starting at 5 means it becomes 6 after the first guess and never equals 5, so only a correct guess can end the loop. It should be Tries ← 0. Tries never increases, so Tries = 5 can never become TRUE. The second way to stop is lost. It should be Tries ← Tries + 1.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 492–534) and word search (Modules 459–534).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
UNTIL Guess = Secret OR Tries = 5Fill in the Blanks
Spot the Error
Student with a class code? Join your class →