Visual repeat, forever and repeat-until blocks to JavaScript
Typed form of a repeat until score = 5 block: keep looping while the opposite is true. A repeat 10 block becomes a for loop, and forever becomes while (true).
Understanding Visual repeat, forever and repeat-until blocks to JavaScript in ACARA Digital Technologies Years 7–8
What it does: forever becomes while (true), which never ends by itself, and the if block from inside it becomes an if statement inside the braces. The variable score is set to 0 before the while loop starts, so the condition score !== 5 has a value to check and the loop can finish. while (score !== 5) keeps running while score is not 5, and stops as soon as score equals 5. That matches repeat until.
Common mistakes: The counter i goes down with i--, so it never reaches 10 and the loop never ends. A repeat 10 block becomes a for loop that counts up with i++. A forever block becomes while (true). With while (false) the condition is never true, so the loop body never runs.
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 599–610) and word search (Modules 583–613).
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
while (score !== 5)Fill in the Blanks
Spot the Error
Student with a class code? Join your class →