Level 2

Pick a Random

Level 2 · Chapter 7

What this lesson follows

CSTA K–12 Computer Science Standards (2017)

Algorithms & Programming · Grades 3–5

Use events, loops and if-then in one program.

Code 1B-AP-10Read the official text

Also practised: 1B-AP-15

Common Core State Standards for Mathematics

Number & Operations in Base Ten · Grade 3

Round, add and take away bigger numbers.

Code 3.NBT.A.1Read the official text

The short lines are our own words. We matched this lesson to these standards ourselves; the standards' owners have not reviewed or endorsed this course.

Common Core State Standards © 2010 National Governors Association Center for Best Practices and Council of Chief State School Officers. All rights reserved.

Today you will use random numbers to make a sprite move unpredictably.

1👋 Warm-Up

For teachers · goals · guide
Lesson Outcomes · for teachersCSTA 1B
✦ CSTA 1B-AP-10 · CSTA 1B-AP-15 · ISTE 1.5.a · Standards
🎯 I canuse random numbers to make a sprite move unpredictably
🧩 New blocks1 block
📝 New words7 words
⏱ Lesson time~35 min
Teacher Guide

📋 Before class

⚠️ Common misconceptions

  • Students may type the same number for both slots, making the range zero — the cat always goes to the same spot.
  • Students may forget that pick random must go INSIDE the go-to block, not beside it.
  • Some students expect the cat to move smoothly; clarify it jumps instantly to a new position.

🎯 Differentiation

🐢 Struggling: Pre-fill the go-to block with one random slot done. Student only needs to drag the second random block.

🚀 Advanced: Send them on to the 🔴 hide-and-seek task: the cat hides, jumps to a random spot, and pops up again, five times.

💡 During the lesson

  • Warm-UpHold up a die. Roll it. Ask: "Did I choose this number?" (No — it was random.) Then ask: "Can Scratch roll a dice?" Build curiosity before opening the computer. A random pick has a minimum 📉 — the smallest number it can give — and a maximum 🔝, the biggest.
    Point to each frame. Ask: "Is the new place the same each time?" (No.) Emphasize: random means different every time. Have two students pick a number from 1–10 — show they pick differently.
  • Try ItThis green Operators block lives INSIDE another block's oval slot. It gives a new number each time the script runs. Show the oval shape — it only fits in oval slots.
    Experiment 1 keeps y fixed — only one axis is random. Experiment 2 shrinks the range (math: small interval). Experiment 3 adds a repeat block — chained randomness. Ask: "Which one made the cat move the most?"
  • PlanDo the first box together. Pick, then watch both stages. Ask: "Pick a random x — what is x? Pick a random y — what is y?" Reinforce that x and y are two different directions.
  • BuildWatch for students who drop the random block beside go-to instead of inside it. Show the oval slot on the x: label — that is where the random block snaps in. Demonstrate the snap sound.