A loop that never stops
A loop that never stops because its stopping condition can never become true. Something inside the loop, like a counter, must change to work towards the condition.
Understanding A loop that never stops in ACARA Digital Technologies Years 5–6
What it does: This step changes count each time round, so it gets closer to the number that stops the loop. An infinite loop keeps going because nothing makes the stopping condition true. The number of steps does not matter. Changing the variable is not enough. It must change in a way that works towards the stopping condition. Taking 1 away from n each time counts down to 0. Adding 1 makes n bigger and bigger, so it never reaches 0. A step after the loop only runs when the loop ends. It cannot help the loop stop. It must be inside the loop.
Common mistakes: The count starts at 1 and goes up, so it can never equal 0. The loop never stops. It should say REPEAT UNTIL count = 5. Lives start at 3 and go down, so they will never reach 5. The stopping condition must be something the loop works towards: REPEAT UNTIL lives = 0.
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 106–119) and word search (Modules 106–132).
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
infinite loopFill in the Blanks
Spot the Error
Student with a class code? Join your class →