Year 3 loops go further: loops that repeat several instructions, loops mixed with other code, and nested loops — a loop inside another loop.
What your child will learn
- Work out what loops with several instructions do
- Count the actions in a nested loop
- Combine loops with other instructions
- Rewrite repeated code as a loop
Loops inside loops
A nested loop repeats a loop. “Repeat 3 × (repeat 4 × clap)” gives 3 × 4 = 12 claps. Nested loops connect coding with multiplication, which children are learning at the same age.
Example questions
Here are a few questions like the ones in the first quest. Can you solve them?
1. True or false? The robot moves 1 squares.
Show answer
Answer: False. The loop repeats "move ←" 3 times, so the robot moves 3 squares.
2. Which loop makes the robot do exactly these moves?
- repeat 6 × →
- repeat 7 × →
- repeat 6 × ←
- repeat 5 × →
Show answer
Answer: repeat 6 × →. The moves → happen 6 times, so "repeat 6 × →" does the same job with less code.
3. Which loop makes the robot do exactly these moves?
- repeat 3 × ↓
- repeat 2 × ↑
- repeat 3 × ↑
- repeat 4 × ↑
Show answer
Answer: repeat 3 × ↑. The moves ↑ happen 3 times, so "repeat 3 × ↑" does the same job with less code.
Tips for grown-ups
- Act out nested loops: “3 times: do 4 jumps”.
- Ask your child to write a loop for a dance or exercise routine.