Mini Minds Hub · Free printable

Poem Machine Algorithm: Free Printable Worksheet for Year 6

In short: Free printable Poem Machine Algorithm for Year 6 (ages 10 to 11). Follow the machine, then debug it. Screen-free, with answers and notes for grown-ups.

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

Poem Machine Algorithm asks Year 6 children (ages 10 to 11) to follow a machine that writes a poem, then debug a second machine that does not print what it should. It suits children who can read simple instructions and are ready to explain why a program behaves the way it does.

Before they answer anything, model one trip round the loop of Machine A out loud. Write count on the page, then cross it out and write the new value each time it changes. The usual slip is to skim the whole machine and guess the poem. Writing count down after every loop stops that.

What is on the sheet

Children trace Machine A with a pencil, keeping track of count as it changes. They write the first line it prints, work out which word the IF chooses, count how often a word appears and find the final value of count. They then change the repeat and write a new line. In Machine B they write what it really prints, using slashes between lines, then fix the bug and explain the fix in one sentence.

  • Machine A: what is count when the machine starts?
  • Write the first line that Machine A prints.
  • Count is 2. Which word does the IF choose, splash or drip?
  • How many times does the word splash appear in the whole poem?
  • What is the value of count when the loop has finished?
  • Change Machine A to REPEAT 6 times. Write line 5 of the new poem.
  • Machine B: write what it really prints. Use a slash between lines.
  • Write the one instruction that fixes Machine B and say where it goes.
  • Explain in one sentence why your fix works.

Worked example: a different machine

Start with count at 20. REPEAT 3 times: take 4 off count. IF count is more than 10, print owl, otherwise print bat. What does the machine print, and what is count at the end?

This machine uses different words and numbers from the sheet. It shows two ways to trace a machine.

Method 1: a trace table
  1. Draw two columns, one headed count and one headed word.
  2. Loop 1: 20 take away 4 is 16. 16 is more than 10, so write owl.
  3. Loop 2: 16 take away 4 is 12. 12 is more than 10, so write owl.
  4. Loop 3: 12 take away 4 is 8. 8 is not more than 10, so write bat.
Method 2: read it like a robot
  1. Say each instruction aloud in order and do only that instruction.
  2. After every change, say the new count and write it down.
  3. Make the IF decision using the count you have just written, not the old one.
  4. When the loop has run three times, stop and read your list of words.
It prints owl, owl, bat, and count ends at 8.

How to trace a machine carefully

Use a trace table

Draw columns for count and word. Fill in one row for each trip round the loop. Children can see the whole run on one page and check it later.

Cover and reveal

Cover the machine with a strip of paper. Slide it down one instruction at a time, so the child only does the step they can see.

Update before you decide

Ask children to write the new count first and only then look at the IF. Deciding with an old value is a very common slip.

Trace what it does, not what it means

For the bug, ask children to ignore what the poem should say and follow the instructions exactly. The machine can only do what it is told.

What is an algorithm?

An algorithm is a set of clear steps, in order, that gets a job done. A recipe is one. So is a set of directions to a friend's house. Computers need algorithms written very precisely, because they do exactly what they are told and nothing more. Three ideas appear again and again: sequence, which means steps in order, selection, which means choosing between options, and repetition, which means doing something again.

A poem machine is a playful way to see those ideas working together. A loop repeats the steps. A variable such as count changes as the machine runs. An IF statement uses count to choose what to print. A bug is a mistake in the instructions, and debugging means finding it and fixing it. Programmers spend a lot of time debugging, so it is a useful habit to practise.

Algorithm facts for curious children

  • An algorithm is a list of steps, and people use them every day, not only computers.
  • A computer follows instructions exactly. It cannot guess what the writer meant.
  • A loop lets a program repeat steps without writing them out again and again.
  • A bug is a mistake in a program's instructions. Fixing bugs is called debugging.
  • Changing the order of instructions can change what a program does.

Skills and curriculum link

  • Following an algorithm
  • Repetition and selection
  • Finding and fixing bugs
  • Tracing a variable
  • Explaining reasoning

Ideas to help you support your child

  • Slow the machine downAsk your child to do one instruction at a time and say what has changed. Rushing ahead is the main cause of wrong answers.
  • Keep a running recordEncourage a small table or a note beside the machine. A written record is easier to check than a mental one.
  • Ask for the reasonWhen they choose between two options, ask them to say which condition decided it. Explaining the choice shows real understanding.
  • Treat bugs as normalFinding a bug is part of programming, not a failure. Praise the careful reading that spots it.

Key words

  • AlgorithmA set of clear steps, in order, for doing a task.
  • LoopA part of an algorithm that repeats its steps a set number of times.
  • VariableA named place that stores a value which can change. Count is a variable.
  • IF statementAn instruction that checks a condition and chooses what to do next.
  • BugA mistake in an algorithm that makes it behave in the wrong way.
  • DebugTo find 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. Read Machine A together. Point to each instruction in turn and say what it does in your own words.
  3. Let your child trace the machine with a pencil, writing count down each time it changes.
  4. Move on to Machine B. Ask them to follow it exactly, then find the bug and write the fix.
  5. Check with page 2 and ask your child to explain how they decided. Come back to it another day if you like.

Help, stretch and game ideas

If it feels too hard

Draw a small table with two columns headed count and word. Fill it in one trip round the loop at a time. Use a finger or a ruler to follow the instructions, and say each step aloud before writing anything down.

To stretch confident children

Invent a third machine that uses a loop and an IF. Hide one bug inside it. Write out what it should print and what it really prints. Swap with a partner and ask them to find and fix the bug.

Make it a game

Play robot poet. One person reads a machine aloud in a flat robot voice, one instruction at a time. A partner writes each line it prints. Swap roles, then compare the poems and check them against the machine.

Mistakes to watch for

Watch forA child decides the IF using the old value of count, not the new one.

Try thisAsk them to write the new count first, then look at the IF. A trace table with a count column makes this easy to see.

Watch forA child counts the number of loops when asked how often a word appears.

Try thisUnderline the word in the finished poem and count only those. Compare it with the number of times the loop ran.

Watch forIn Machine B, a child writes the poem the machine was meant to print.

Try thisCover the poem idea and follow each instruction literally. Ask, "What does the machine do here, exactly?"

Talk about it

  • What does an algorithm need to be able to do its job well?
  • Why does the order of the instructions matter?
  • How did you keep track of count as it changed?
  • How would you explain what an IF does to a younger child?
  • How did you spot the bug in Machine B?
  • Can you think of an algorithm you follow at home or school?

Take it off the page

Human robot

One person gives step by step instructions to cross a room. The other follows them exactly. Notice what goes wrong when an instruction is missing or unclear.

Drawing by instructions

Write instructions for a simple picture without naming the shape. A partner draws it from your steps alone. Compare drawings, then debug the instructions.

Loop it

Write a short dance or exercise routine that uses a repeat, such as repeat 4 times. Perform it and see how a loop saves writing.

Who it is for

Parents

Sit with your child for the first machine, then let them lead. Ask them to explain each choice aloud. If they are stuck, suggest the count and word table from page 2 rather than giving the answer.

Teachers

Use it as a starter or plenary after teaching sequence, selection and repetition, or as an early finisher task. Page 2 gives support, stretch and answers, so it works for mixed ability groups with no preparation beyond printing.

Home educators

Pair it with unplugged activities such as writing instructions for everyday jobs. Children can then see algorithms away from the screen. Use the debugging task to talk about checking work and learning from mistakes.

Where this fits in computing

Before this, children learn that algorithms are steps in order, and that computers need precise instructions. They may have used simple repeats in programs and begun to spot and correct mistakes in short sequences.

After this, children work with variables, more conditions and longer programs. They design, write and debug programs of their own, and explain how an algorithm works. Tracing by hand, as here, builds the habit of reading code carefully.

Keep practising

If this sheet went well, find more in our Year 6 computing worksheets and Year 6 worksheets and games, or try Frozen Cave Loop Quest, Data on the Move Tickets, Cyberbullying Response Cards or Fairy Tale Flowchart Fix next.

Browse: Mini Minds Hub > Year 6 worksheets and games > Year 6 computing worksheets

Questions parents and teachers ask

What age is Poem Machine Algorithm for?

It is written for Year 6, ages 10 to 11, in Key Stage 2. Younger children who enjoy computing may manage it with support, and older children can use it as quick revision of tracing and debugging.

What will my child practise?

They practise following an algorithm that uses sequence, a repeat loop and an IF statement. They also find and fix a bug, and explain why their fix works. These are core ideas in primary computing.

Does my child need a computer?

No. It is a screen free activity and needs only paper and a pencil. Children trace the machines by hand, which helps them understand what each instruction really does.

What if my child finds it hard?

Suggest a small table with the columns count and word, filled in one loop at a time. Doing one instruction at a time and writing every change down usually makes the machine much easier to follow.

Where are the answers?

They are on page 2, which is for the grown-up. That page also has notes on using the sheet, help for children who find it hard and a stretch idea. Keep it back until your child has tried.

Can teachers use it in class?

Yes. It works as a starter, plenary, early finisher task, homework or table activity. It needs no preparation beyond printing, and the support and stretch ideas help with mixed ability groups.

Does my child need to know how to code?

No. Everything they need is on the page. If they know what a loop and an IF are, it will feel familiar. If not, working through the first machine together is a good way to learn.

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.