← Years 5–6 Creating Digital Solutions

Turning an algorithm into a visual program

Turn each algorithm step into a matching block: SET becomes set, ASK becomes ask and wait, IF becomes if, REPEAT becomes repeat. Then run it to check it does what the algorithm says.

Understanding Turning an algorithm into a visual program in Years 5–6 Creating Digital Solutions

What it does: IF in an algorithm matches the 'if' block. The condition goes in the hexagon slot and the steps to do go inside the block. SET becomes the 'set' block. It gives the variable its starting value. ASK becomes 'ask and wait'. It waits for the user to type an answer. A 'say' block only shows a message and does not wait for a reply. Always run your program and compare what happens with the algorithm. This helps you spot any mistakes. Sequence matters. Blocks run from top to bottom, so they must match the order of the algorithm steps.

Common mistakes: The algorithm step is SET score to 0, so it needs the 'set' block. 'change ... by' only adds to the old value, so the score would not start at 0. It should be: set score to 0. Each time round the loop the algorithm adds 1 to steps, so it needs the 'change by' block. 'set' would put steps back to 1 every time. It should be: change steps by 1.

Class: _____________________  ·  Name: _____________________  ·  Date: _________

Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.

This module's key terms are also in a printable crossword (Modules 61–74) and word search (Modules 41–74).

Take this worksheet further — free with Cloodit

Each concept is reinforced from every angle — learned, then applied, then tested.

Learning
Duo
An algorithm step says: SET score TO 0. Which block matches it?
ask and waitset score to 0
Matches
Algorithm: SET lives TO 3. Program: a 'change lives by 3' block
↓
SET was matched to the wrong block. 'change' adds to the old value instead of giving a fresh starting value.
Applying
Meanings
Term
step -> block
Meaning
Turn each algorithm step into a matching block: SET becomes set, ASK becomes ask and wait, IF becomes if, REPEAT becomes repeat. Then run it to check it does what the algorithm says.
Practice
when green flag clicked
Testing
Gaps
score to 0
Check Answer
Spots
1when green flag clicked
2change score by 0

Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.

The 'Fox' badge — Cunning Debugger, one of Cloodit's 106 collectible badges
Students earn collectable badges

Over 100 of them, across seven natural biomes.

Study Buddy
Students build a real study resource

Turns their work into revision material ready for Flash Cards and Exam study.

Diamond Dash — one of Cloodit's live, competitive Sprint games
Students lock in with Sprints

Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.

A Cloodit certificate of achievement, ready to personalise and print
Custom printable certificates

Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.

Quick Questions

1. An algorithm step says: SET score TO 0. Which block matches it?
A. set score to 0 ✓
B. ask and wait
SET becomes the 'set' block. It gives the variable its starting value.
2. An algorithm step says: ASK 'What is your name?'. Which block matches it?
A. ask What is your name? and wait ✓
B. say What is your name? for 2 seconds
ASK becomes 'ask and wait'. It waits for the user to type an answer. A 'say' block only shows a message and does not wait for a reply.
3. An algorithm says: REPEAT 10 TIMES. Which block should you use?
A. if 10 then
B. repeat 10 ✓
REPEAT becomes the 'repeat' block. An 'if' block only makes a choice. It does not repeat steps.
4. An algorithm says: IF score > 5 THEN. Which block matches this step?
A. if score > 5 then ✓
B. repeat score > 5
IF becomes the 'if' block. The condition goes inside the hexagon slot.
5. After you build a visual program from an algorithm, what should you do next?
A. Leave it, because blocks never have mistakes
B. Run it and check it does what the algorithm says ✓
Always run your program and compare what happens with the algorithm. This helps you spot any mistakes.

Match the Pairs

SET score TO 0 → Becomes a 'set score to 0' block in the visual program
ASK "What is your name?" → Becomes an 'ask What is your name? and wait' block
An algorithm step that makes a decision becomes an 'if' block with the condition inside it → IF score > 5 THEN
An algorithm step that repeats a set number of times becomes a 'repeat 10' block → REPEAT 10 TIMES
Algorithm: SET lives TO 3. Program: a 'change lives by 3' block → SET was matched to the wrong block. 'change' adds to the old value instead of giving a fresh starting value.
Algorithm: ASK "Your age?". Program: a 'say Your age?' block → ASK was matched to 'say', which only shows a message. It does not wait for an answer.

Key Term

step -> block
Turn each algorithm step into a matching block: SET becomes set, ASK becomes ask and wait, IF becomes if, REPEAT becomes repeat. Then run it to check it does what the algorithm says.

Fill in the Blanks

1. SET score TO 0 set score to 0
Hint: Type the block name that matches the SET step.
2. ASK for the player's name ask What is your name? and wait
Hint: Type the block word that matches the ASK step.
3. IF score > 5 THEN if <score > 5> then
Hint: Type the block name that matches the IF step.
4. REPEAT 4 TIMES repeat 4
Hint: Type the number of times the algorithm says to repeat.
5. ask What is your name? and wait set name to answer
Hint: Type the reporter block that holds what the user typed in.

Spot the Error

Question 1
A when green flag clicked
B change score by 0
C ask [2 + 3 = ?] and wait
D if <answer = 5>
E change score by 1
Line B — The algorithm step is SET score to 0, so it needs the 'set' block. 'change ... by' only adds to the old value, so the score would not start at 0. It should be: set score to 0.
Question 2
A when green flag clicked
B set steps to 0
C repeat 5
D set steps to 1
E say steps
Line D — Each time round the loop the algorithm adds 1 to steps, so it needs the 'change by' block. 'set' would put steps back to 1 every time. It should be: change steps by 1.
Question 3
A say [Your name?] and wait
B set name to answer
C say (join [Hi ] (name))
Line A — The algorithm step ASK becomes the 'ask and wait' block. 'say' only shows a speech bubble and does not wait for the user to type. It should be: ask [Your name?] and wait.
Question 4
A make total equal 0
B repeat 4
C change total by 5
D say total
Line A — There is no 'make ... equal' block. The algorithm step SET becomes the 'set ... to' block. It should be: set total to 0.
Question 5
A when green flag clicked
B ask [Colour?]
C if <answer = blue>
D say [Nice choice!]
Line B — The ASK step becomes the 'ask and wait' block. Without 'and wait' the program does not stop for the typed answer, so 'answer' is not ready for the if block. It should be: ask [Colour?] and wait.

Student with a class code? Join your class →