Skip to content

Day 9: Loops

Thursday, March 26th, 2026

Objectives

  • I can use loops to repeat blocks of code in Scratch.
  • I can identify when to use loops to make my code more efficient.

Warmup: Introduction to Loops

  1. Watch this video. This is from the first level of the Code.org lesson.
  1. Login to Clever and complete levels 1-5 of Lesson 12: Loops with Rey and BB-8 on Code.org.

Login with Clever

Code.org

  1. Here is a link to the second video. The videos in the lesson are served by Youtube which is blocked at school. The link is an alternative that should work even at school.

Checkpoint: Warmup

  • I have watched the video on loops.
  • I have completed levels 1-5 of Lesson 12: Loops with Rey and BB-8 on Code.org.

Work Session: Loops in Scratch

We have already used the forever loop in Scratch.

forever

The forever block will repeat the blocks inside forever until the program is stopped. The computer will repeat the code has fast as it can.

This is useful for things that we want to keep checking for.

Gravity Example

when green flag clicked
forever
if <not (onground)> then
change y by (-10)

Loops Make Code More Efficient

Loops can also be used to make code more efficient. Instead of writing the same blocks over and over, we can use a loop to repeat them.

Which of these is best?

when green flag clicked
pen down
move (10) steps
turn cw (90) degrees
move (10) steps
turn cw (90) degrees
move (10) steps
turn cw (90) degrees
move (10) steps
turn cw (90) degrees
when green flag clicked
pen down
repeat (4)
move (10) steps
turn cw (90) degrees 

Try it Yourself

Start with this Scratch Project. It doesn’t use loops yet, but it does work. Your job is to make the code more efficient by using loops.

Checkpoint: Work Session

  • I have used loops to make code more efficient.
  • I can explain why using loops is more efficient than writing the same blocks over and over.

Closing: Code.org

For the closing, login to Clever and complete levels 6-10 of Lesson 12: Loops with Rey and BB-8 on Code.org.

Standards

  • MS-CS-FCP.3.2 — Develop a working vocabulary of computational thinking including sequences, algorithms, and iteration (loops).
  • MS-CS-FCP.4.1 — Develop a working vocabulary of programming including coding, debugging, user interfaces, usability, variables, lists, loops, conditionals, programming language, and events.
  • MS-CS-FCP.4.5 — Implement a simple algorithm in a computer program.
  • MS-CS-FCP.4.8 — Create a computer program that implements a loop.
Last updated on