Score variable worksheet for Years 5–6: Set and change

Members Chapter 2 of Variables in Coding: Build Scores and Timers with Bit · Year 5, Year 6 · 3 pages · PDF, A4

All 5 worksheets in this game

One for each chapter

Set and Change is a printable coding worksheet for Years 5 and 6 (ages 9 to 11) that teaches children to use set and change blocks to start a score at 0 and add to it. It follows the national curriculum in England for Key Stage 2 computing: use sequence, selection and repetition in programs, and work with variables and various forms of input and output.

  • 3 A4 pages
  • Answers sheet
  • About 25 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: What is a variable? (chapter 1).

The game for this worksheet Variables in Coding: Build Scores and Timers with Bit Chapter 2 · Scores: setting and changing a variable · read aloud ▶ Play chapter 2 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 set and change blocks to start a score at 0 and add to it, and find bugs where set and change are mixed up. Includes a sock shoot scoring game, code tracing and an answers sheet.

Page 1 · Learn
Before-and-after pictures showing set score to 1 and change score by 1, a worked trace of a score script, Flip's tip on setting the score to 0, and a warm-up.
Page 2 · Try it together
Sock shoot: throw a rolled-up pair of socks into a basket, saying set score to 0 at the start and change score by 1 for each throw that goes in.
Pages 2–3 · Practise
Work out the score after six set and change blocks, trace three scripts, fix a set-instead-of-change bug and find the missing reset block in Mia's game.
Answers sheet
Every answer by page, what to watch out for (mixing up set and change, forgetting to reset) and ideas to go further.

3 A4 pages and an answers sheet · about 25 minutes

Using it at home

  • Play Sock shoot before the Practise pages and say the blocks aloud. If your child writes 1 for every throw that goes in, ask: is that set or change?
  • Practise set and change in any board game you play this week: set score to 0 at the start, change score by 1 for each point.

Watch out for

Mixing up set (replace the value) and change (add on to the value).
Ask: do we want to keep what is there and add to it? Then use change. To start again, use set.
Forgetting to set the score back to 0 when a new game starts.
Put set score to 0 straight after when game starts, so every game begins at 0.

Questions from the worksheet

  1. score is 5. What is it after change score by -1?
  2. Find the bug. The score should go up by 1 for each star collected, but it always shows 1.
  3. Mia's first game ends with a score of 8. When she plays again, the score starts at 8, not 0. Which block is missing?
  4. Sam says change score by -2 does the same as set score to -2. Is he right? Try it with a score of 10.

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

  • Use set A as a mini-whiteboard check: show each block and ask for the new score.
  • Play Sock shoot in teams with paper balls, with one pupil as the scorekeeper calling set and change.

Questions and answers

What is the difference between set and change in coding?

Set gives a variable a new value and throws the old one away. Change adds a number on to the value the variable already has, so change score by 1 adds one point.

Why should a score be set to 0 at the start of a game?

A variable keeps its last value, so without set score to 0 a new game would carry on from the old score.

More worksheets from Variables in Coding: Build Scores and Timers with Bit

More Year 5 technology worksheets

One for every chapter of every game, with answers.

Browse them →