Forever loops worksheet for Years 3–6

Members Chapter 3 of Make Your Own Game: Code a Catching Game with Hazel · Year 3, Year 4, Year 5 · 3 pages · PDF, A4

All 7 worksheets in this game

One for each chapter

Forever Loops is a printable forever loops worksheet for Years 3 to 6 (ages 7 to 11) that teaches children to use a forever loop to keep something moving in a game and put blocks that happen once before the loop. It follows the KS2 computing national curriculum in England: use sequence, selection and repetition in programs.

  • 3 A4 pages
  • Answers sheet
  • About 30 minutes
  • Colour or black and white
  • National curriculum

For members Membership opens every worksheet and every game. Already a member? Log in

Start with the free one: Plan a game (chapter 1).

The game for this worksheet Make Your Own Game: Code a Catching Game with Hazel Chapter 3 · Keep things moving with a forever loop (repetition) · read aloud ▶ Play chapter 3 in the gameChapter 1 is free

Print it on A4, in colour or black and white. Do it after the chapter, or before it to see what your child already knows.

What's on the worksheet

Use a forever loop to keep a falling apple moving, put the start position before the loop, and choose between forever and repeat. Includes acting out human loops at home, and answers.

Page 1 · Learn
Flip explains a forever loop with a falling apple script, then traces y going down by 5 each time round. A warm-up sorts jobs into repeat or forever.
Page 2 · Try it together
Human loops: act out programs with repeat 5, forever and a buggy loop that keeps sending you back to the door, then hunt for loops at home.
Pages 2–3 · Practise
Trace y in a table, match three scripts to what the apple does, choose forever or repeat 3 for each job and explain where the start block goes. Then a challenge about repeat 10.
Answers sheet
Every answer by page, what to watch out for (start position inside the loop, move block outside it, repeat instead of forever) and quick ideas.

3 A4 pages and an answers sheet · about 30 minutes

Using it at home

  • Act out the three human loop programs first. Program C, the buggy loop, shows the most common mistake in a way children remember.
  • When tracing, let your child count down in fives out loud: 170, 165, 160.

Watch out for

Putting the start position inside the loop, so the object keeps jumping back.
Ask "Does this need to happen once, or again and again?" Blocks that happen once go before the loop.
Putting the moving block outside the loop, so it only moves once.
Blocks that keep happening go inside the loop.
Using repeat 10 when something needs to keep going for the whole game.
Repeat stops after its number. Forever keeps going until the game stops.

Questions from the worksheet

  1. The apple starts at y: 170. Each time round the loop: change y by -5. What is y after loop 4? After loop 10?
  2. Draw a ring round the loop each job needs: the apple falls all through the game; the basket flashes 3 times when the game starts.
  3. Why does go to x: 0 y: 170 go before the forever loop, not inside it?
  4. Leo used repeat 10 instead of forever. What happens to his apple after it has moved 10 times? How far has it moved?

The answers are on the answers sheet, for grown-ups.

National curriculum in England

This worksheet practises this statement from the Years 3–6 computing programme of study:

  • Use sequence, selection, and repetition in programs; work with variables and various forms of input and output

Source: National curriculum in England: computing programmes of study (DfE)

In the classroom

  • Act out program C as a whole class to show why a start block inside a loop is a bug.
  • Use Practise B in pairs: each child explains one script to their partner before drawing the line.

Questions and answers

What is a forever loop in coding?

A forever loop runs the blocks inside it again and again until the program stops. Games use forever loops to keep things moving, like an apple falling.

What is the difference between repeat and forever?

A repeat loop runs a set number of times, such as repeat 10, then stops. A forever loop keeps going until the whole program stops.

More worksheets from Make Your Own Game: Code a Catching Game with Hazel

More Year 3 technology worksheets

One for every chapter of every game, with answers.

Browse them →