KeyStage

Key Stage 1 computing · Algorithms and programming

KS1 coding: creating simple programs, a guide for parents

In Years 1 and 2, children make their first programs. They work from a goal, plan the steps, build a short sequence of commands, run it and improve it. It is taught hands-on, usually with a programmable floor robot or by snapping together blocks on a screen, rather than by typing code. The skill being built is careful, step-by-step thinking.

Creating simple programs, explained

The programme of study asks children to create and debug simple programs, and to understand that a program follows precise, unambiguous instructions. In Key Stage 1 that means making something small that works. A first program might make a robot travel around a mat, or make a character on screen move and say something. It is learned by doing, which is why this topic is mostly practical.

Schools choose the equipment. Many use programmable floor robots, which have buttons for moving forward and backward and for turning. Children often work on a mat marked in squares, so they can count how far the robot should go. Others use block-based tools on a tablet or computer, where each command is a coloured block and blocks only fit together in valid ways, so there are no spelling mistakes to worry about. Both teach the same ideas, and some schools use both.

Children usually follow a cycle. They decide what they want to happen, plan the steps, build the program, run it and look at what happened. They then change something and run it again. It is normal for the first attempt not to work, and teachers often say so out loud, because children who expect to get it right first time can lose confidence. Fixing a program that went wrong is covered on its own page.

What children can do grows over the two years. In Year 1, they usually make short sequences of a few commands and may need help counting squares and judging turns. By Year 2, many are building longer programs, combining movement with other actions such as sound or speech, and planning on paper before they begin. Some schools introduce a repeat command for children who are ready, but the main idea at this stage is sequence: commands carried out in order.

You don’t need any technical knowledge to help. The most useful questions are “What do you want it to do?”, “What is the first thing it needs to do?” and “What happened when you ran it?” Those three questions keep the focus on the thinking rather than on the equipment, and they work with a robot, a tablet or a handful of paper arrows.

Words your child will hear

Program
A set of commands that makes a device do a job.
Sequence
Commands in order, each one carried out before the next begins.
Block
A piece on the screen that stands for one command. Blocks snap together to build a program.
Floor robot
A small programmable robot that moves across the floor or a mat when its commands are run.
Sprite
A character or picture on the screen that a program can move, change or make speak.
Run
To make the program start. Pressing Go on a robot or the start button on a screen runs it.
Test
To run a program and see whether it does what you planned.

What the National Curriculum says

In Key Stage 1, pupils should be taught to:

  • Create and debug simple programs
  • Understand what algorithms are, how they are implemented as programs on digital devices, and that programs execute by following precise and unambiguous instructions

Objectives from the National Curriculum in England, © Crown copyright, used under the Open Government Licence v3.0.

Try it: building a program for a character on screen

Make a character walk across the screen, say “Hello” and then make a sound. Use blocks. The tool has a start block that runs the program when the start button is pressed, and blocks for “move forward 5”, “say …” and “play a sound”. Block names differ between tools, but most have blocks like these.

  1. Decide the goal and plan in words first: the character walks forward, says hello, then makes a sound. That is three actions, in that order.
  2. Choose a block for each action. Walking is the “move forward 5” block, speaking is the “say” block with “Hello” typed into it and the sound is the “play a sound” block. The program also needs the start block, so that it runs when the start button is pressed.
  3. Snap the blocks together in order, with the start block on top. If a block is left on its own it will not run with the others, so check that they are all joined in a single stack.
  4. Press the start button to run the program. Watch carefully: does the character move before it speaks, and is there a sound at the end? Compare this with the plan.
  5. Improve it. Change one thing, such as the number in the move block, and run it again to see what that number does. Changing a single thing at a time shows exactly what each change causes.

The program is a stack of four blocks: start, move forward 5, say Hello, play a sound. The character moves, speaks and then plays the sound, in that order. Changing the number in the move block changes how far it moves.

Common mistakes and how to help

Believing a program that doesn’t work first time means “I got it wrong”

In many school subjects a wrong answer counts against you, so children expect to get programming right straight away.

What helps: Say that checking and improving is how programming works, and that everyone does it. Praise a good second attempt as much as a good first one.

Leaving blocks unattached or forgetting the start block, then wondering why nothing happens

Blocks look as if they belong together when they sit close on the screen, but only joined blocks form a program.

What helps: Ask your child to point to the first block and follow the stack down. Any block not in the stack is not part of the program.

Counting squares or judging turns wrongly with a floor robot

Children often count the square the robot is standing on, and many see left and right from their own viewpoint rather than the robot’s.

What helps: Count the squares the robot will move into, using a finger. Let your child stand in the robot’s place and face the way it faces before deciding on a turn.

Building a long program in one go

It feels more efficient, but if something goes wrong it is hard to see where.

What helps: Suggest building two or three commands, running them, and then adding more. A bug is much easier to find in a short program.

How to help at home

  • Human robot in the hall or garden. Mark a start and a target with a cushion and a teddy. Your child writes or says a program using forward, left and right, and you follow it exactly. If you end up in the wrong place, work out together which command to change.
  • Chalk or tape a grid. Draw a grid with chalk on a patio or use floor tiles. A toy or a counter stands in for the robot. Count squares with a finger before deciding how many Forward commands to use.
  • Plan first, then build. Before any screen or robot comes out, ask your child to say what they want to happen and the order of the steps. Then check the finished program against the plan.
  • Build in small steps. If your child uses a block-based tool at school or home, encourage a few blocks at a time, running the program after each addition. It makes mistakes easier to find and the program more likely to work.
  • Ask your child to teach you. Ask them to show you how their robot or character program works. Explaining each command in order is excellent practice, and you can ask what would happen if they changed one number.

More on algorithms and programming

Everything in Key Stage 1 computing

Updated .