Creating my own algorithm with branching, repetition and a counter
A finished algorithm joins steps, a decision (IF), a loop (REPEAT) and a counter to solve a school, game or recipe problem. You check it by following it step by step.
Understanding Creating my own algorithm with branching, repetition and a counter in ACARA Digital Technologies Years 5–6
What it does: The counter eggs goes up by 1 each time round the loop, so the loop stops when 3 eggs have been added. The IF decides which pencils to count, REPEAT goes through every pencil, and count keeps the total. A counter is a variable that changes by a set amount, like lives going down by 1. The IF is the decision. A counter that only counts some things needs an IF to choose which ones. IF ... THEN ADD 1 to count completes the idea. Combining sequence, branching, repetition and a counter lets one algorithm solve a bigger problem. Add SET count TO 0 before the REPEAT so the count starts at a known value.
Common mistakes: An IF decision needs the word THEN after its condition. Line 3 should be: IF bag is packed THEN. A set-number loop must say TIMES so we know it repeats a fixed number of times. Line 2 should be: REPEAT 3 TIMES.
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 120–132) and word search (Modules 106–132).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
REPEAT + IF + countFill in the Blanks
Spot the Error
Student with a class code? Join your class →