A loop repeats instructions. Instead of writing “move right” five times, a programmer writes “repeat 5 × move right”. Loops make programs shorter, clearer and easier to change.
What your child will learn
- Work out what a repeat loop does
- Count the total moves made by a loop
- Replace a long list of repeated steps with a loop
- Combine a loop with other instructions
Why loops matter
Loops are one of the most powerful ideas in coding. Loop Lagoon uses colourful code blocks, like the ones in Scratch and ScratchJr, so children learn to read the kind of code they will meet in real coding apps.
A great way to understand a loop is to “unroll” it: “repeat 3 × (→ ↑)” means → ↑ → ↑ → ↑.
Example questions
Here are a few questions like the ones in the first quest. Can you solve them?
1. How many squares does the robot move?
- 2
- 5
- 4
- 7
Show answer
Answer: 4. The loop repeats "move ↓" 4 times, so the robot moves 4 squares.
2. How many squares does the robot move?
Show answer
Answer: 4. The loop repeats "move ↑" 4 times, so the robot moves 4 squares.
3. How many squares does the robot move?
- 1
- 3
- 6
- 4
Show answer
Answer: 3. The loop repeats "move ←" 3 times, so the robot moves 3 squares.
Tips for grown-ups
- Make up a dance with a loop: “repeat 4 times: clap, stamp”.
- Spot loops in songs and stories with repeating lines.