Code Haven Week 3


Topics: Loops, Randomness

Topics: Loops, Randomness

Week 3 Overview


  • Introduce and practice the concept of loops
  • Ensure that students understand the difference between while (repeat until) and for (repeat x times) loops in Scratch

Materials and Resources

Lesson Plan Overview

View our detailed lesson plan here.

  • Introduction (5 min): Review conditionals
  • Unplugged Activity (10 min): Dance Party activity!
  • Live Coding (10 min): Demonstrate types of loops in Scratch
  • Worksheet (30 min): Log into Scratch accounts and work on the worksheet
  • Wrap up (5 min): See how loops fit with the maze activity

Video Materials

We’ve produced exciting videos that go over the topics outlined in our lesson plan. These can serve as inspiration for how you could conduct your lessons. If you or the students don’t have time to watch the videos…check out our quick cheat sheet


Part 1: Painting in Scratch!

Let’s make the Scratch Cat paint a line on the screen!

image #1

- Click the + button in the bottom left corner and add the pen extension to your Scratch environment

- First, make the cat put the pen down when the flag is clicked 

- Then, make the cat take 20 steps forward and wait 1 second. This should repeat 10 times.

Here’s the Block Bank:

bb #1

Question: What does your cat draw when you click the flag?

Part 2: Painting With Many Colors!

Let’s make the Scratch Cat draw a multicolored shape on the screen!

image #2

- Again, make Scratch put the pen down when we press the flag.

- Then, make the Scratch Cat move 50 steps, turn 45 degrees, and change pen colors - 8 times in a row.

Here’s the Block Bank:

bb #2

Question: What’s the difference between what your cat draws in part 1 and part 2? What new blocks are used in part 2?

Part 3: Randomness!

Let’s make the Scratch Cat draw a picture that includes random elements!

image #3

- Again, make Scratch put the pen down when we press the flag.
- Now, create a loop that will repeat 100 times.
- Inside the loop, move a random number of steps, turn a random number of degrees, and change pen color by a random number.
- Finally, add a block to make sure that Scratch will bounce when he hits the edge of the screen!

Here are some blocks to get you started:

bb #3


Can you change your drawing so that it uses two loops?

How else can we use randomness to make your drawing even more unique?