Primary teacher guide

Coding games for Year 5 and 6

By Ash, Computing teacher and founder of RADevo · · 5 minute read

Year 5 and 6 pupils love games, and games are a natural way into programming. The trick is choosing activities where the computing idea is the game, not a reward bolted on afterwards. Here are coding games and activities for upper KS2 that teach sequence, loops, selection and debugging.

Sequence: the robot game

Draw a grid maze on the board (or chalk one on the playground) with a "robot" at the start and a target at the end. Pupils write a program using only three instructions: forward, turn left and turn right. One pupil plays the robot and follows the program exactly, even when it's wrong.

Loops: shorter programs

Once pupils can steer the robot, design mazes with a repeating pattern, like a staircase (forward, turn right, forward, turn left, over and over). Count the instructions in their program, then introduce a repeat block: "repeat 3 times: forward, turn right, forward, turn left". The program is now much shorter. Challenge pupils to solve a maze in as few blocks as possible.

The most common loop mistake is putting the wrong instructions inside the loop. Ask pupils to point to exactly which steps repeat, and to say how many times the robot will move forward in total.

Selection: choose your own adventure

Selection is about the program making a choice. A simple unplugged game: write an algorithm for a playground game with if… then… else rules ("if you're tagged, then sit down, else keep running"). Then build a short quiz program on screen that checks an answer: if the answer is right, add one to the score and say "Well done", else say "Try again".

Variables: keep the score

A score is the easiest variable to understand. Ask pupils what should happen to the score when an answer is right, and when it's wrong. Then make it more interesting: lives that go down, a timer that counts, a level that goes up after five right answers. Each one is a variable that changes.

Debugging: bug hunts

Show a short program with one deliberate bug and ask pupils to find and fix it. Make bugs realistic: a block in the wrong order, a loop that repeats the wrong number of times, a condition the wrong way round. Celebrate finding bugs. Debugging is what programmers spend much of their time doing, and it builds logical reasoning more than writing new code does.

Algorithms everywhere: the instructions game

Ask pairs to write instructions for something everyday, such as making a jam sandwich or drawing a simple shape, then swap with another pair who must follow them exactly as written. The results are usually funny, and they make a serious point: an algorithm has to be precise and in the right order, because a computer can't guess what you meant. Afterwards, ask pupils to improve their instructions and try again. That's an algorithm being tested and debugged.

For mixed-ability classes

What the research says

Making games count

How RADevo helps

RADevo's Robot Rescue is the robot game on screen. Pupils earn a block for each right answer to a computing question, then put the blocks in order, with Repeat loops, to steer a robot through a maze and rescue a pet. When the robot bumps into a wall, they debug their program. Later levels give a star for solving the maze with a loop in few blocks. It works for one pupil at their own pace, or for the whole class on the board at the end of a live quiz. See the KS2 computing quizzes and RADevo for primary schools.

References

Teaching KS2 Computing?

Set every topic as homework in two clicks, see who has done it and which questions your class got wrong, and start every lesson with a Do Now built from their mistakes.

Start a free 2-week trial

Revising for this?

If your school uses RADevo, sign in to do the full quizzes and keep your progress. If it doesn't, show this page to your Computing teacher.

Log in to RADevo