Mini Minds Hub · Free printable

Garden Trail Algorithm: Free Printable Worksheet for Year 5

In short: Free printable Garden Trail Algorithm for Year 5 (ages 9 to 10). Trace the grid, then write and fix routes. With answers for grown-ups.

  • ForYear 5
  • StageKey Stage 2
  • CostFree
  • FormatPrintable PDF

Garden Trail Algorithm asks Year 5 children (ages 9 to 10) to trace routes on a garden grid, then write and fix algorithms, including one that uses a repeat. It suits children who have met simple commands and are ready to shorten and check them. It takes about 30 minutes, needs a pencil, and page 2 gives the grown-up help ideas, a stretch task and the answers.

Before anyone writes, put a counter on the Gate and move it exactly as each command says. The usual slip is counting the starting square as the first step, so watch for that. If the counter ends in the wrong place, that tells you which command to look at again.

What is on the sheet

Children begin with a grid map of a garden. They trace routes with a finger or a counter, then write algorithms of their own, such as a route from the Gate to the Woods and another from the Gate to the Lake using one repeat. There is a table to fill in, two true or false items and numbered questions with space to answer. Children also trace if then rules and debug routes, which means finding a mistake in a route and fixing it.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • Write an algorithm from the Gate to Woods.
  • Write an algorithm from the Gate to the Lake using one repeat.

Worked example: shortening a route with a repeat

A robot starts at the Shed and must reach the Pond. The long route is: Right, Right, Right, Right, Up, Up, Up. Write it using repeats.

This example uses its own small map and its own commands, so it does not give away any answer on the sheet.

Method 1: spot the runs
  1. Look for the same command written several times in a row.
  2. Right appears 4 times in a row. Write it as Repeat 4: Right.
  3. Up appears 3 times in a row. Write it as Repeat 3: Up.
  4. Put the two parts in the same order as the long route.
Method 2: trace to check
  1. Put a counter on the Shed.
  2. Move it 4 squares right, then 3 squares up.
  3. Check that it lands on the Pond.
  4. Count the commands in the long route. 4 and 3 make 7, so the short route should do 7 moves in total.
Repeat 4: Right. Repeat 3: Up.

How the sheet builds

Trace first

Children follow routes with a finger or counter before they write anything. Seeing where each command takes the counter makes the later writing easier to check.

Write a route

An algorithm is a list of clear steps in order. Children write one command at a time, so each step has a visible effect on the grid.

Use a repeat

When the same command comes up several times in a row, a repeat can replace it. Children decide what to repeat and how many times.

Find the bug

Debugging means tracing a route until the counter goes somewhere unexpected. Children then fix that command and trace again.

Why algorithms and repeats matter

An algorithm is a set of steps in a clear order that leads to a result. Computers follow algorithms exactly, with no guessing. That is why each command has to be precise. A route on a grid is a good way to practise this, because children can see straight away whether the steps did what they meant.

Many algorithms contain patterns. When the same step happens several times, programmers use a repeat, sometimes called a loop, so they do not have to write it out again and again. Shorter algorithms are quicker to read and easier to fix. Checking an algorithm by following it step by step is a real programming habit.

Algorithm facts

  • An algorithm is a set of steps in order that solves a problem or completes a task.
  • Computers follow instructions exactly as they are written. They do not fill in missing steps.
  • A repeat in a program is often called a loop.
  • A mistake in a program is called a bug. Finding and fixing it is called debugging.
  • You can follow an algorithm without a computer. A pencil, paper and a counter are enough.

Skills and curriculum link

  • Writing algorithms
  • Using repeats
  • If then rules
  • Debugging
  • Logical reasoning
  • Following instructions precisely

Ideas to talk about

  • AlgorithmAn algorithm is a list of steps in order. Changing the order of the steps can change where you end up.
  • RepeatA repeat does the same command more than once. It needs two details: what to do and how many times.
  • If then rulesAn if then rule only happens when its condition is true. Check the if part first, then decide whether the then part applies.
  • DebuggingFollow the algorithm one command at a time. The bug is at the first command where the result is not what you wanted.

Key words

  • AlgorithmA set of steps in order that gets a job done.
  • CommandOne clear instruction, such as moving one square.
  • RepeatDoing the same command again, a set number of times.
  • If then ruleA rule that says: if something is true, then do this.
  • BugA mistake in a set of instructions.
  • DebugFind a bug and fix it.

How to use it

  1. Print both pages. Page 1 is for your child. Keep page 2, which has the notes and answers.
  2. Look at the grid together. Put a counter on the Gate and ask your child to say where the other places are.
  3. Work through the first items together. Let your child trace each route with a finger or counter before writing.
  4. Check against page 2. Ask, "Where did the counter go?" and trace any route that does not match.
  5. Come back to it another day and redo any route that felt tricky. Allow about 30 minutes for the whole sheet.

Help, stretch and game ideas

If it feels too hard

Let your child move a counter one command at a time and say each command aloud. Start with the two true or false items and items 1 to 3. Come back to the rest later, once the counter and the words feel connected.

To stretch confident children

Choose a new start square on the grid and say a route with one repeat aloud. A partner traces it with a counter and says where it ends. Then swap roles and see whether the route can be made shorter.

Make it a game

Swap sheets with a partner. One reads an algorithm aloud while the other moves a counter. Both check where the counter stops. Take turns, and add a deliberate bug for the other person to find.

Mistakes to watch for

Watch forA child counts the starting square as the first move, so the route ends one square short.

Try thisPlace the counter on the start and say it is already there. Move it one square for each command and count only the moves.

Watch forA repeat has the wrong number, so the counter overshoots or stops early.

Try thisTrace the route and count squares aloud. Change the number in the repeat and trace again until the counter lands in the right place.

Watch forA child rewrites the whole route to fix a bug.

Try thisTrace until the counter first leaves the path. The bug is at that command. Change that one command, then trace the whole route again.

Talk about it

  • What is the first command in your algorithm, and why does it come first?
  • How did you decide what to repeat?
  • What would happen if two commands swapped places?
  • How did you find the bug? Which command was it?
  • Is there a shorter way to write this route?
  • Where would you start a new route, and where would it finish?

Take it off the page

Human robot

Mark a grid on the floor or pavement with chalk. One person gives commands and the other walks them out one square at a time. Swap roles.

Draw your own map

Draw a small grid on paper and place three places on it. Write an algorithm between two of them and ask someone to trace it.

Spot the bug

Write a short route with one deliberate mistake. Give it to a partner and ask them to trace it, find the bug and fix it.

Who it is for

Parents

Sit beside your child for the first go and let them lead. Use a coin or button as a counter. If a route goes astray, ask them to trace it again and say each command aloud.

Teachers

Use it as a starter, plenary, early finisher task or table activity. It needs no preparation beyond printing. Counters let pairs check each other's routes, and page 2 gives support, stretch and answers.

Home educators

Print it as part of a wider computing plan. It works well alongside the human robot idea outdoors. Brothers and sisters can write routes for each other, and the sheet can be repeated for revision.

Where this fits

Before this sheet, children usually give simple step by step directions and follow instructions in the right order. They are used to the idea that a computer does exactly what it is told.

After it, children can write longer algorithms with more than one repeat, use if then rules in more places and test their own programs on screen. The habits of tracing, checking and debugging carry across to all of these.

Keep practising

If this sheet went well, find more in our Year 5 computing worksheets guide, or try What Does This Algorithm Do?, Data on the Move Tickets, Bailey's Code Block Match or Fairy Tale Flowchart Fix next.

Questions parents and teachers ask

How long does Garden Trail Algorithm take?

It takes about 30 minutes. Children can stop after the first few items and come back another day. Page 2 has ideas to make it shorter for children who need support or longer for those ready for more.

What do children need?

They need a pencil and, if they like, a counter, coin or button to move on the grid. Print both pages. Black and white on plain A4 paper works well.

What is an algorithm?

An algorithm is a set of clear steps in order that completes a task. On this sheet, the task is moving along the garden grid from one place to another.

What is a repeat in an algorithm?

A repeat is a way to do the same command more than once without writing it out each time. It needs the command and the number of times to do it.

What if my child finds it hard?

Let them move a counter one command at a time and say each command aloud. Start with the two true or false items and items 1 to 3. Return to the rest on another day.

What if my child is ready for more?

Ask them to choose a new start square and say a route with one repeat aloud. A partner traces it on the grid and reports where it ends. They can then try to shorten the route.

Do I need coding knowledge to help?

No. Page 2 has the answers and notes. Your main job is to ask your child to trace each route with a counter and say what happens at each command.

Preview the full PDF

Made by Jaques of London, making games for families since 1795. A printable supports classroom learning and does not replace a teacher.