Learning objective
Loops & Repetition
Loops & Repetition
Understanding count-controlled loops, infinite loops, repeat-until loops, and nested repetition structures across unplugged, visual block, and text-based coding.
Y1 โ Physical Repetition
Identify repeating patterns in everyday actions and physical routines.
Let's Go!
Learn
A loop is an instruction that tells us to repeat an action. Instead of saying 'clap, clap, clap', we can say 'repeat 3 times: clap'. This makes instructions shorter and easier to follow! In computing, repeating actions allow humans and machines to perform routines efficiently. As you explore the interactive Block Coding Simulator below, focus on how to identify repeating loops in physical routines and state the repeat count.
Select blocks from the palette on the left to build your program stack.
Assemble blocks in the Studio to inspect the syntax tree.
| Step | Block Instruction | Sprite (X, Y) | Variables | Status |
|---|---|---|---|---|
| No script execution traces yet. Click ๐ฉ Go to record runtime data. | ||||
Apply Simulator Skills โข Try it yourself
Create a Physical Loop Routine
๐ Open a practice space
Or try locally: ๐ Raspberry Pi Projects
๐ Student Project GuideSuccess Criteria & WAGOLL (What A Good One Looks Like)
๐ฏ Task Success Criteria (Rubric)
Recognise when an action is repeated.
Count how many times an action repeats in a simple dance or clapping pattern.
Identify repeating loops in physical routines and state the repeat count.
Create original physical repetition routines and explain why repeating beats saves instruction steps.
๐ What A Good One Looks Like (WAGOLL)
When you finish creating your project in your software, copy the share link or take a screenshot and publish it onto your student portfolio website!
Reflect
Learning check
Teacher setup, curriculum links and progress descriptors
Spark support
Routine: Think-Pair-Share
Teacher notes: Facilitate the Think-Pair-Share routine for 2โ3 minutes. Encourage students to connect the prompt to Form (Repeating actions allow humans and machines to perform routines efficiently.).
Achievement pathway
- Foundation: Recognise when an action is repeated.
- Developing: Count how many times an action repeats in a simple dance or clapping pattern.
- Secure: Identify repeating loops in physical routines and state the repeat count.
- Mastering: Create original physical repetition routines and explain why repeating beats saves instruction steps.
Curriculum links
Curriculum strand: coding/loops-repetition
Outcome: LOOP.01.B.1.1 โ Identify repeating patterns in everyday actions and physical routines.
PYP: Form ยท Repeating actions allow humans and machines to perform routines efficiently.
Learner profile: Inquirer
Competency tags
Gate support
Accessibility alternative: Students may verbally explain or point to the correct answer for "What does a loop do in a sequence of instructions?" with a teacher or teaching assistant.
Teacher override: allow
Locked level
Level 2: Y2 โ Count-Controlled Loops
Complete the previous learning check to unlock this next level.
Y2 โ Count-Controlled Loops
Use repeat blocks with fixed counts in visual block programs.
Learning objective
Program a sprite to execute actions using a count-controlled repeat block.
Let's Go!
Learn
In block coding, a 'repeat [N]' block wraps around other blocks like a sandwich. Any blocks inside the repeat loop will execute N times before moving to the next block below. In computing, count-controlled loops execute precise repetitions in digital algorithms. As you explore the interactive Audio Soundboard Simulator below, focus on how to use count-controlled repeat loops to draw regular geometric shapes or repeat multi-block movement scripts.
Apply Simulator Skills โข Try it yourself
Program a Square Walk Pattern
๐ Open a practice space
Or try locally: ๐ Raspberry Pi Projects
๐ Student Project GuideSuccess Criteria & WAGOLL (What A Good One Looks Like)
๐ฏ Task Success Criteria (Rubric)
Place a repeat block around a single movement block.
Set a repeat count number to move a sprite across a grid.
Use count-controlled repeat loops to draw regular geometric shapes or repeat multi-block movement scripts.
Compare a script written with loops to one written linearly without loops, explaining code efficiency.
๐ What A Good One Looks Like (WAGOLL)
When you finish creating your project in your software, copy the share link or take a screenshot and publish it onto your student portfolio website!
Reflect
Learning check
Teacher setup, curriculum links and progress descriptors
Spark support
Routine: Think-Pair-Share
Teacher notes: Facilitate the Think-Pair-Share routine for 2โ3 minutes. Encourage students to connect the prompt to Function (Count-controlled loops execute precise repetitions in digital algorithms.).
Achievement pathway
- Foundation: Place a repeat block around a single movement block.
- Developing: Set a repeat count number to move a sprite across a grid.
- Secure: Use count-controlled repeat loops to draw regular geometric shapes or repeat multi-block movement scripts.
- Mastering: Compare a script written with loops to one written linearly without loops, explaining code efficiency.
Curriculum links
Curriculum strand: coding/loops-repetition
Outcome: LOOP.02.B.1.2 โ Use repeat blocks with fixed counts in visual block programs.
PYP: Function ยท Count-controlled loops execute precise repetitions in digital algorithms.
Learner profile: Communicator
Competency tags
Gate support
Accessibility alternative: Students may verbally explain or point to the correct answer for "If a repeat block is set to 5 and contains 'move 10 steps', how many steps will the sprite move in total?" with a teacher or teaching assistant.
Teacher override: allow
Locked level
Level 3: Y3 โ Forever & Infinite Loops
Complete the previous learning check to unlock this next level.
Y3 โ Forever & Infinite Loops
Construct infinite repetition loops for continuous background animations and game monitoring.
Learning objective
Utilize 'forever' loops to maintain continuous sprite animations and ongoing condition checking.
Let's Go!
Learn
A 'forever' loop runs continuously until the program is stopped manually. It is used for ongoing tasks like costume animations, background scrolling, or constantly checking if a key is pressed. In computing, infinite loops allow programs to run background tasks continuously. As you explore the interactive Animation Simulator below, focus on how to construct forever loops that continuously monitor game conditions or animate backgrounds.
Animation Controls
6 FPS Stop-Motion๐ท Camera Capture & Frame Looping
Capture still drawings and watch persistence of vision connect them into a fluid motion loop.
Persistence of vision keeps images lingering in our retina for 1/16th of a second, blending still pictures into moving cinema!
Apply Simulator Skills โข Try it yourself
Animate a Flying Bird Sprite
๐ Open a practice space
Or try locally: ๐ Raspberry Pi Projects
๐ Student Project GuideSuccess Criteria & WAGOLL (What A Good One Looks Like)
๐ฏ Task Success Criteria (Rubric)
Identify a forever block in the block palette.
Wrap a costume-switching script inside a forever loop to create walking animations.
Construct forever loops that continuously monitor game conditions or animate backgrounds.
Explain when to use a forever loop versus a count-controlled loop in game design.
๐ What A Good One Looks Like (WAGOLL)
When you finish creating your project in your software, copy the share link or take a screenshot and publish it onto your student portfolio website!
Reflect
Learning check
Teacher setup, curriculum links and progress descriptors
Spark support
Routine: Think-Pair-Share
Teacher notes: Facilitate the Think-Pair-Share routine for 2โ3 minutes. Encourage students to connect the prompt to Change (Infinite loops allow programs to run background tasks continuously.).
Achievement pathway
- Foundation: Identify a forever block in the block palette.
- Developing: Wrap a costume-switching script inside a forever loop to create walking animations.
- Secure: Construct forever loops that continuously monitor game conditions or animate backgrounds.
- Mastering: Explain when to use a forever loop versus a count-controlled loop in game design.
Curriculum links
Curriculum strand: coding/loops-repetition
Outcome: LOOP.03.B.1.3 โ Construct infinite repetition loops for continuous background animations and game monitoring.
PYP: Change ยท Infinite loops allow programs to run background tasks continuously.
Learner profile: Thinker
Competency tags
Gate support
Accessibility alternative: Students may verbally explain or point to the correct answer for "Which type of loop never stops repeating until the red stop button is clicked?" with a teacher or teaching assistant.
Teacher override: allow
Locked level
Level 4: Y4 โ Repeat Until Conditionals
Complete the previous learning check to unlock this next level.
Y4 โ Repeat Until Conditionals
Implement conditional loops that repeat actions until a specific sensing condition is met.
Learning objective
Build scripts using 'repeat until' loops governed by touch or sensing conditions.
Let's Go!
Learn
A 'repeat until [condition]' loop evaluates its condition before every iteration. It repeats the enclosed actions continuously until the condition evaluates to true, then stops looping and moves to the next block. In computing, conditional loops enable dynamic algorithmic responses based on real-time environmental data. As you explore the interactive Spreadsheet Simulator below, focus on how to program game sprites to move continuously until hitting an obstacle or reaching a target.
| A | B | C | |
|---|---|---|---|
| 1 | Item | Amount | |
| 2 | Apples | 5 | |
| 3 | Bananas | 3 | |
| 4 | Carrots | 2 | |
| 5 | Total |
Apply Simulator Skills โข Try it yourself
Program an Obstacle-Stopping Vehicle
๐ Open a practice space
Or try locally: ๐ Raspberry Pi Projects
๐ Student Project GuideSuccess Criteria & WAGOLL (What A Good One Looks Like)
๐ฏ Task Success Criteria (Rubric)
Identify the sensing condition slot in a repeat-until block.
Combine a touching-color or touching-mouse sensor with a repeat-until loop.
Program game sprites to move continuously until hitting an obstacle or reaching a target.
Debug scripts where repeat-until conditions never become true (preventing infinite hanging).
๐ What A Good One Looks Like (WAGOLL)
When you finish creating your project in your software, copy the share link or take a screenshot and publish it onto your student portfolio website!
Reflect
Learning check
Teacher setup, curriculum links and progress descriptors
Spark support
Routine: Think-Pair-Share
Teacher notes: Facilitate the Think-Pair-Share routine for 2โ3 minutes. Encourage students to connect the prompt to Connection (Conditional loops enable dynamic algorithmic responses based on real-time environmental data.).
Achievement pathway
- Foundation: Identify the sensing condition slot in a repeat-until block.
- Developing: Combine a touching-color or touching-mouse sensor with a repeat-until loop.
- Secure: Program game sprites to move continuously until hitting an obstacle or reaching a target.
- Mastering: Debug scripts where repeat-until conditions never become true (preventing infinite hanging).
Curriculum links
Curriculum strand: coding/loops-repetition
Outcome: LOOP.04.B.1.4 โ Implement conditional loops that repeat actions until a specific sensing condition is met.
PYP: Connection ยท Conditional loops enable dynamic algorithmic responses based on real-time environmental data.
Learner profile: Principled
Competency tags
Gate support
Accessibility alternative: Students may verbally explain or point to the correct answer for "When does a 'repeat until [touching edge]' loop stop repeating its inner blocks?" with a teacher or teaching assistant.
Teacher override: allow
Locked level
Level 5: Y5 โ Nested Loops
Complete the previous learning check to unlock this next level.
Y5 โ Nested Loops
Place loops inside other loops to construct multi-dimensional grids, patterns, and nested iterations.
Learning objective
Design algorithms with nested loops to create 2D grid layouts and complex geometric patterns.
Let's Go!
Learn
Nested loops occur when one loop (the inner loop) is placed entirely inside another loop (the outer loop). For every single pass of the outer loop, the inner loop completes all of its iterations. In computing, nested loops enable the automated generation of complex multi-dimensional patterns and structures. As you explore the interactive Python Console Simulator below, focus on how to use nested loops with pen blocks to draw complex tiled patterns or generate 2D grid coordinates.
Type Python code in the IDE to view real-time AST node tree parsing.
| Identifier | Type | Value | Scope |
|---|---|---|---|
| No active variables in memory. Assign variables (e.g. score = 100) to inspect. | |||
Apply Simulator Skills โข Try it yourself
Draw a Grid of Geometric Shapes
๐ Open a practice space
Or try locally: ๐ Raspberry Pi Projects
๐ Student Project GuideSuccess Criteria & WAGOLL (What A Good One Looks Like)
๐ฏ Task Success Criteria (Rubric)
Recognize an inner loop placed inside an outer loop.
Calculate the total number of iterations in a nested loop (outer count x inner count).
Use nested loops with pen blocks to draw complex tiled patterns or generate 2D grid coordinates.
Optimize nested loop algorithms to avoid performance lag in complex graphical applications.
๐ What A Good One Looks Like (WAGOLL)
When you finish creating your project in your software, copy the share link or take a screenshot and publish it onto your student portfolio website!
Reflect
Learning check
Teacher setup, curriculum links and progress descriptors
Spark support
Routine: Think-Pair-Share
Teacher notes: Facilitate the Think-Pair-Share routine for 2โ3 minutes. Encourage students to connect the prompt to Perspective (Nested loops enable the automated generation of complex multi-dimensional patterns and structures.).
Achievement pathway
- Foundation: Recognize an inner loop placed inside an outer loop.
- Developing: Calculate the total number of iterations in a nested loop (outer count x inner count).
- Secure: Use nested loops with pen blocks to draw complex tiled patterns or generate 2D grid coordinates.
- Mastering: Optimize nested loop algorithms to avoid performance lag in complex graphical applications.
Curriculum links
Curriculum strand: coding/loops-repetition
Outcome: LOOP.05.B.1.5 โ Place loops inside other loops to construct multi-dimensional grids, patterns, and nested iterations.
PYP: Perspective ยท Nested loops enable the automated generation of complex multi-dimensional patterns and structures.
Learner profile: Knowledgeable
Competency tags
Gate support
Accessibility alternative: Students may verbally explain or point to the correct answer for "If an outer loop runs 5 times and contains an inner loop that runs 4 times, how many total times do the blocks inside the inner loop run?" with a teacher or teaching assistant.
Teacher override: allow
Locked level
Level 6: Y6 โ Loop Optimization & Text Loops
Complete the previous learning check to unlock this next level.
Y6 โ Loop Optimization & Text Loops
Transition loop concepts into text-based languages (for/while) and analyze computational loop efficiency.
Learning objective
Write text-based 'for' and 'while' loops in Python and analyze algorithmic loop complexity.
Let's Go!
Learn
In text coding like Python, `for i in range(10):` runs a loop a fixed number of times, while `while condition:` repeats as long as a condition remains True. Proper indentation defines the code inside the loop body. In computing, loop optimization and iteration structures are fundamental to efficient software execution. As you explore the interactive Microcontroller Simulator below, focus on how to construct text-based while loops with counter variables and condition updates.
| Sensor Input | Bus Type | Raw Digital | Converted Unit |
|---|---|---|---|
| โ๏ธ Photocell (Light) | Internal Matrix | 128 | 50% Lux |
| ๐ก๏ธ Thermistor (Temp) | I2C Subsystem | 490 | 24ยฐC |
| ๐ณ Accelerometer (X,Y,Z) | LSM303AGR I2C | (0, 0, 1024) | 1.0g Flat |
| ๐ GPIO Pin 0 | Edge Connector | 0 | 0.0V (Low) |
Apply Simulator Skills โข Try it yourself
Build a Python Countdown Loop
๐ Open a practice space
Or try locally: ๐ Raspberry Pi Projects
๐ Student Project GuideSuccess Criteria & WAGOLL (What A Good One Looks Like)
๐ฏ Task Success Criteria (Rubric)
Identify 'for' and 'while' keywords in simple Python code.
Translate a block repeat loop into a Python `for i in range(N):` statement.
Construct text-based while loops with counter variables and condition updates.
Evaluate nested loop complexity O(n^2) and refactor inefficient loop structures to improve program execution speed.
๐ What A Good One Looks Like (WAGOLL)
When you finish creating your project in your software, copy the share link or take a screenshot and publish it onto your student portfolio website!
Reflect
Learning check
Teacher setup, curriculum links and progress descriptors
Spark support
Routine: Think-Pair-Share
Teacher notes: Facilitate the Think-Pair-Share routine for 2โ3 minutes. Encourage students to connect the prompt to Reflection (Loop optimization and iteration structures are fundamental to efficient software execution.).
Achievement pathway
- Foundation: Identify 'for' and 'while' keywords in simple Python code.
- Developing: Translate a block repeat loop into a Python `for i in range(N):` statement.
- Secure: Construct text-based while loops with counter variables and condition updates.
- Mastering: Evaluate nested loop complexity O(n^2) and refactor inefficient loop structures to improve program execution speed.
Curriculum links
Curriculum strand: coding/loops-repetition
Outcome: LOOP.06.B.1.6 โ Transition loop concepts into text-based languages (for/while) and analyze computational loop efficiency.
PYP: Reflection ยท Loop optimization and iteration structures are fundamental to efficient software execution.
Learner profile: Reflective
Competency tags
Gate support
Accessibility alternative: Students may verbally explain or point to the correct answer for "In Python text coding, how is the code inside a loop body identified?" with a teacher or teaching assistant.
Teacher override: allow




