Creative Coding Studio · Lesson 3

Studio build: replace repetition with a loop

Ākonga take a working but repetitive project and compress it with repeat and forever blocks, then justify why the shorter version is easier to change.

Other teaching approach: Unplugged Computational Thinking Seminar →
Year 7 Digital Technology · Computational Thinking

Lesson 3: Repeating Actions: Iteration with Repeat & Forever Loops

Developing computational thinking through Scratch block coding, algorithms, and Te Ao Māori perspectives.

🎯 Ngā Whāinga Akoranga | Learning Intentions

🧠 Students will know:

The concept of iteration (loops), difference between count-controlled loops ('repeat 10') and infinite loops ('forever'), and code efficiency.

✏️ Students will demonstrate:

Replace repetitive sequential blocks with compact loop blocks, animate sprite walking cycles, and draw geometric shapes using the Pen extension.

🎥 Media Anchor & Pedagogical Scaffold

Scratch: Repeat and Forever Loops

Video Clip: Clear explanation of how repeat and forever loop blocks work in Scratch — when to use each, and how they change how your program runs.

🧠 1. Before Viewing (Activate & Predict)

Why write 20 identical lines of code when you can tell the computer to repeat a block 20 times?

👁️ 2. During Viewing (Watch With a Job)

  • Watch the full clip. As you watch, note the difference: when does a repeat loop stop, and when does a forever loop stop?
  • Think of one example in a game where you would use repeat, and one where you would use forever — jot them down.
  • After watching, try building the loop example shown in Scratch and change the repeat number to see what happens.

🗣️ 3. After Viewing & Kaiako Move (Process & Apply)

Kaiako Move: Demonstrate the Scratch Pen extension drawing colourful polygons (squares, triangles, hexagons) using loop mathematical angles.

Immediate Task: Complete Section 3 of your Digital Tech Logbook: Loop Efficiency Audit & Scratch Pen Geometric Art.

⚡ Whakaoho | Do Now: Square in Eight Lines (10 mins)

On paper, write the instructions for drawing a square — four sides, four turns — in exactly eight lines. Count them. Today's question: what if Scratch needs that sequence forty times — do you really want to write it out forty times?

📖 Activity 1: The Polygon Machine — Repeat With Two Numbers (25 mins)

Add the Pen extension and build the polygon drawer with the projector: repeat 4 [move 100 steps; turn 90 degrees] draws a square. Change only the two numbers — 3 and 120, then 6 and 60, then 8 and 45 — and predict the shape before every run. Each pair then writes a mystery polygon's two numbers on a slip; the other pair runs it and names the shape it drew. Finish with forever [turn 3 degrees] and say what "iterates forever" looks like on the stage.

📝 Activity 2: Digital Tech Logbook & Code Reflection (20 mins)

Draft your formal Digital Tech Logbook entry for Lesson 3. Apply exact programming vocabulary (e.g., repeat, forever, iteration, polygon, angle, efficiency) to explain your code decisions.

🏫 Kaiako Planning & Pedagogy Notes

Year 7 Curriculum Alignment: Iteration with repeat and forever loops (NZC Technology; Te Mātaiaho Phase 3) — Lesson 2's long sequences collapse into one loop block and two numbers.