Day 9: Loops
Thursday, March 26th, 2026
Warmup: Introduction to Loops
- Watch this video. This is from the first level of the Code.org lesson.
- Login to Clever and complete levels 1-5 of Lesson 12: Loops with Rey and BB-8 on Code.org.
- 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.
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.
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