Skip to content
Computing · Year 5

Active learning ideas

Loops for Repetition

Active learning helps students grasp loops for repetition because they immediately see how repeating code blocks saves time and reduces errors. When students build, test, and debug their own projects, they experience firsthand why fixed loops and repeat-until loops behave differently.

National Curriculum Attainment TargetsKS2: Computing - Programming and Algorithms
25–45 minPairs → Whole Class4 activities

Activity 01

Project-Based Learning30 min · Pairs

Pair Programming: Pattern Builder

Pairs use Scratch to draw a repeating pattern of shapes with a 'repeat' block. One partner adds code while the other suggests loop counts and predicts outcomes. They test, adjust the repeat number, and explain efficiency gains to the class.

Explain the benefit of using a loop instead of writing the same code multiple times.

Facilitation TipDuring Pair Programming: Pattern Builder, circulate and ask each pair to verbalize their loop structure before coding to reinforce planning.

What to look forProvide students with a simple Scratch project showing a sprite drawing a square using a fixed loop. Ask them to answer: 1. How many times does the loop repeat? 2. What would happen if you changed the number in the loop to 5? 3. Write one sentence explaining why a loop was useful here.

ApplyAnalyzeEvaluateCreateSelf-ManagementRelationship SkillsDecision-Making
Generate Complete Lesson

Activity 02

Project-Based Learning45 min · Small Groups

Small Groups: Loop Type Challenges

Groups tackle three tasks: fixed repeat for a spiral, repeat until a sprite touches an edge, and mixed loops for a game animation. They record differences in a shared document and present one demo.

Design a program that uses a loop to draw a repeating pattern.

Facilitation TipIn Small Groups: Loop Type Challenges, give each group one loop snippet to test and swap it with another group after 5 minutes to broaden perspective.

What to look forDisplay two code snippets side-by-side: one using a fixed loop to draw 5 circles, and another using a condition-controlled loop that stops when a sprite reaches a certain X-coordinate. Ask students to identify which loop is which and explain one scenario where the other type of loop would be more appropriate.

ApplyAnalyzeEvaluateCreateSelf-ManagementRelationship SkillsDecision-Making
Generate Complete Lesson

Activity 03

Project-Based Learning25 min · Whole Class

Whole Class: Debug Relay

Display buggy looped code on the board. Class calls out fixes in turns, teacher inputs changes, and all predict results before running. Vote on best solutions and discuss why loops failed.

Compare 'repeat until' loops with 'repeat a number of times' loops.

Facilitation TipFor Whole Class: Debug Relay, assign roles so every student participates, such as reader, typist, and observer to keep everyone engaged.

What to look forPose the question: 'Imagine you need to make a program that prints the numbers 1 to 100. Would you use a fixed loop or a condition-controlled loop? Explain your choice and why it's better than writing 'print 1', 'print 2', etc., all the way to 100.'

ApplyAnalyzeEvaluateCreateSelf-ManagementRelationship SkillsDecision-Making
Generate Complete Lesson

Activity 04

Project-Based Learning35 min · Individual

Individual: Custom Loop Design

Pupils design a program with loops for a personal pattern, like a flower or path. They write steps first, code independently, then share screenshots in a class gallery for peer feedback.

Explain the benefit of using a loop instead of writing the same code multiple times.

Facilitation TipDuring Individual: Custom Loop Design, provide printed loop templates for students to annotate before coding to support planning.

What to look forProvide students with a simple Scratch project showing a sprite drawing a square using a fixed loop. Ask them to answer: 1. How many times does the loop repeat? 2. What would happen if you changed the number in the loop to 5? 3. Write one sentence explaining why a loop was useful here.

ApplyAnalyzeEvaluateCreateSelf-ManagementRelationship SkillsDecision-Making
Generate Complete Lesson

A few notes on teaching this unit

Teach loops by having students compare fixed and condition-based loops in the same project. Model how to trace loop execution step-by-step on the board so students see how the loop counter or condition changes each cycle. Avoid jumping straight to abstract explanations; let students observe the loop’s effect through visible outputs like sprites drawing shapes.

Students will confidently use repeat times and repeat until loops to create patterns and solve simple tasks. They will explain the difference between the two loop types and justify their choice based on the task requirements.


Watch Out for These Misconceptions

  • During Pair Programming: Pattern Builder, watch for students assuming all loops run forever.

    Ask pairs to test their fixed loop by setting the count to 3 and observing that it stops, then adjust the repeat until loop to use a simple condition like touching a color edge to see it stops when met.

  • During Small Groups: Loop Type Challenges, watch for students treating repeat until the same as repeat times.

    Have groups run identical tasks with both loop types and note when each loop stops, highlighting that repeat until depends on a condition while repeat times always runs the set number.

  • During Whole Class: Debug Relay, watch for students thinking loops only save time on very long repetitions.

    After debugging, demonstrate how changing loop counts from 10 to 5 or 100 to 10 shows code remains clean and easy to adjust, reinforcing efficiency even for short tasks.


Methods used in this brief