Selection with if blocks worksheet for Years 3–6: If blocks
All 7 worksheets in this game
One for each chapter
If Blocks is a printable selection with if blocks worksheet for Years 3 to 6 (ages 7 to 11) that teaches children to use an if block inside a loop to check for a catch or a miss and choose the right condition. It follows the KS2 computing national curriculum in England: use selection and repetition in programs, and use logical reasoning to detect and correct errors in programs.
- 3 A4 pages
- Answers sheet
- About 30 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: Plan a game (chapter 1).
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 an if block inside a forever loop to check for a catch or a miss, choose the right condition and spot where a check is in the wrong place. Includes a catch rules game with socks, and answers.
- Page 1 · Learn
- Flip explains if blocks with a catching script, then a worked example follows the apple into the basket. A warm-up asks whether the apple is touching the basket.
- Page 2 · Try it together
- Catch rules: throw a soft ball or rolled-up socks 5 times, check an if-then rule after every throw and record what happened, then make up a new rule.
- Pages 2–3 · Practise
- Decide whether if blocks will run, write the right condition in gaps, fix a script with the if outside the loop and finish everyday if-then rules. Then a challenge about the wrong condition.
- Answers sheet
- Every answer by page, what to watch out for (the if outside the loop, the wrong condition) and quick ideas to go further without paper.
3 A4 pages and an answers sheet · about 30 minutes
Using it at home
- Play Catch rules first and say "if… then…" out loud after every throw: it shows why the check sits inside a loop.
- Ask your child to read each if block as a sentence and say whether it makes sense for the game.
Watch out for
- Putting the check outside the loop, so it only checks once at the start.
- Ask "How often does the game need to check?" Every time round, so it goes inside the forever loop.
- Checking the wrong thing, such as touching the ground instead of touching the player.
- Read the if out loud as a sentence. "If touching the ground, say Caught" doesn't make sense.
Questions from the worksheet
- Will the blocks inside the if run? touching Basket? when the apple is in the air.
- Write the right condition in each gap: touching Basket? or touching Ground?
- Ava's game never says "Caught!", even when the apple lands in the basket. Her if block is before the forever loop. What's wrong? How would you fix it?
- Sam's game says "Caught!" every time an apple hits the ground. What's the bug? What should he change?
The answers are on the answers sheet, for grown-ups.
National curriculum in England
This worksheet practises these statements 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
- Use logical reasoning to explain how some simple algorithms work and to detect and correct errors in algorithms and programs
Source: National curriculum in England: computing programmes of study (DfE)
In the classroom
- Use Practise A as a quick show-me: children show thumbs up for yes and thumbs down for no.
- Collect everyday if-then rules from Practise D on the board as a selection starter.
Questions and answers
What is selection in coding?
Selection is when a program makes a choice. An if block checks a condition, and only runs the blocks inside it if the answer is yes.
Why does the if block go inside the forever loop?
Inside the loop, the if checks again and again while the game runs. Outside the loop, it only checks once at the start, so it misses catches.
More worksheets from Make Your Own Game: Code a Catching Game with Hazel
- Chapter 1: Decomposition worksheet: Plan a game Free
- Chapter 2: Inputs and outputs worksheet: Key controls Members
- Chapter 3: Forever loops worksheet Members
- Chapter 5: Variables in coding worksheet: Score variable Members
- Chapter 6: Debugging worksheet: Bug hunt Members
- Chapter 7: Countdown timer and playtesting worksheet: Finish and playtest Members
More Year 3 technology worksheets
One for every chapter of every game, with answers.
