Skip to content

    Until Island

    Year 5 Repeat Until

    Meet loops that don’t count: “repeat until” stops when a condition comes true, and “forever” never stops at all.

    • Ages 9–11
    • 3 quests
    • Beginner → Getting stronger → Challenge

    A “repeat 10” loop counts. But often we don’t know how many repeats we need: keep asking until the password is right; keep moving until you touch the wall. For that, coders use a loop with a stopping condition.

    What your child will learn

    • Know that “repeat until” stops when its condition becomes true
    • Know that a “forever” loop never stops by itself
    • Trace a variable through a loop to find when it stops
    • Spot a loop that can never end

    Check, then repeat

    A “repeat until” loop checks its condition before each round. If the condition is already true, the loop doesn’t run at all. If nothing inside the loop ever changes the condition, it will run forever.

    Skipping past the finish

    A classic bug: “repeat until x = 0” while x goes 5, 3, 1, −1… It jumps straight past 0, so the loop never ends. Using “x < 1” instead catches it. Text languages write the same idea the other way round, as “while x > 0”.

    Example questions

    Here are a few questions like the ones in the first quest. Can you solve them?

    1. 1. A “repeat until” loop keeps going until…

      • its condition becomes true
      • the computer is switched off
      • it has run 10 times
      • its condition becomes false
      Show answer

      Answer: its condition becomes true. The loop stops as soon as the condition is true.

    2. 2. How many times does the loop run?

      • 4
      • 0
      • 2
      • 3
      Show answer

      Answer: 3. Lives goes 2, 1, 0 — three rounds.

    3. 3. What does a “forever” loop do?

      • Runs ten times
      • Repeats without ever stopping by itself
      • Runs exactly once
      • Never runs
      Show answer

      Answer: Repeats without ever stopping by itself. It only ends when the whole program is stopped.

    4. 4. Match each loop to how it behaves.

      • forever
      • repeat until score = 10
      • repeat 10
      • stops when you reach 10
      • runs exactly 10 times
      • never stops
      Show answer

      Answer: forever → never stops · repeat 10 → runs exactly 10 times · repeat until score = 10 → stops when you reach 10. Repeat-until loops check a condition each time.

    Tips for grown-ups

    • Act out a loop: “clap until I say stop” versus “clap five times”.
    • Trace loops with a table: write the variable’s value after every round.
    • In Scratch, try “repeat until touching edge” and watch when it stops.