Skip to content

    Variable Valley

    Year 1 First Variables

    Meet variables: boxes with a name that hold a number. Read a short program and work out what is in the box at the end.

    • Ages 5–7
    • 3 quests
    • Beginner → Getting stronger → Challenge

    A variable is a box with a name on it that holds a number. A game uses variables to remember your score, your lives and how many coins you have. Year 1 coders read tiny programs that put a number in a box and then change it.

    What your child will learn

    • Know that a variable has a name and holds a value
    • Understand that “set” puts a new number in the box
    • Understand that “change by” makes the number go up or down
    • Follow a short program step by step to find the final value

    Set, then change

    “Set score to 2” puts 2 in the box called score. “Change score by 1” adds 1, so the box now holds 3. “Change score by −1” takes 1 away. The box only ever holds one number: the newest one.

    Read it like a robot

    Computers follow a program one line at a time, from the top. To find the answer, do the same: say the number after every line, and don’t skip ahead.

    Example questions

    Here are a few questions like the ones in the first quest. Can you solve them?

    1. 1. What is apples at the end?

      • 4
      • 1
      • 5
      • 6
      Show answer

      Answer: 5. apples starts at 1. 1 + 4 = 5. So apples ends at 5.

    2. 2. What is coins at the end?

      Show answer

      Answer: 1. coins starts at 0. 0 + 1 = 1. So coins ends at 1.

    3. 3. What is apples at the end?

      Show answer

      Answer: 4. apples starts at 2. 2 + 2 = 4. So apples ends at 4.

    Tips for grown-ups

    • Use a real box and some blocks: “set” means empty it and put that many in, “change” means add or take away.
    • Keep score in a game together and say “change score by 1” for every point.
    • Ask “What is in the box now?” after each step.