Today you will collect data from clicks, show it on monitors, and loop over the counts to find which is most.
1 Warm-Up
2 Predict
3 Try It
4 Plan
5 Build
6 Fix It
7 Extend
8 Math Challenge
For teachers · goals · guide
Lesson Outcomes · for teachersCSTA 2
✦ CSTA 2-DA-08 · ISTE 1.5.b · Standards
| 🎯 I can | collect data from clicks, show it on monitors, and loop over the counts to find which is most |
| 🧩 New blocks | 1 block |
| 📝 New words | 5 words |
| ⏱ Lesson time | ~45 min |
Teacher Guide
📋 Before class
⚠️ Common misconceptions
- Students think the count goes up by itself. It does not. Each click runs one change-by-1 block. No click, no count.
- Students think one
>test finds the most. It does not. The loop reads every item of the list and keeps the bigger number each time, so the answer intopis only final after the last item.
🎯 Differentiation
🐢 Struggling: Use only two colors and two buttons first. Put both counts in the counts list and show them with show variable. Click each button a few times, then ask: which number is bigger? Add the third color after that works.
🚀 Advanced: Keep a colors list beside the counts list. When the loop keeps a new top count, also store item (i) of [colors], so the sprite says the winning color name and not just its number.
💡 During the lesson
- Warm-UpDo this with real hands before screens. Name three colors, have students raise a hand for one, and tally on the board. Ask: "Which color won? How do you know?" The answer — "it had the biggest number" — is the compare step they will code today. Keep it to counting and comparing; no graphing yet.
- Try ItIn the first experiment,
addputs each vote at the end of the list;insertputs it at the front, so the newest vote is on top. The second experiment keeps the list and the count together — the list grows, and the monitor number grows with it. Let students see that the list length and the count tell the same story two ways. - PlanTrace the comparer lane with students. The three counts are copied into one list, so the comparer never names a color again — it names positions. Start with item 1 as the top, then let the loop read item 2 and item 3 and keep the bigger number each pass. Ask what happens to the loop when a fourth color is added:
length of countsbecomes 4, and the same script still works. That is why the loop replaces a stack of if blocks. - BuildHave students trace one run on paper: i = 1, 2, 3, with the value of top written after each pass. The loop body does two jobs — compare and keep, then step i forward — and both must sit inside the repeat. Watch for the student who drops the
change i by 1at the bottom outside the C block; the loop then reads item 1 three times and the answer is wrong without any error message.
Show the picture first. Ask what will happen — everyone points or says one word.
Everyone picks an answer first. Then press the flag together.
Change one thing at a time. Run it, watch, then change the next thing.
Pairs put the cards in order before anyone opens Scratch.
Students build step by step. Walk around — help with questions, not with the mouse.
Ask: what did we want, and what did it do? Let them find it.
Fast finishers pick the next tier. Everyone else finishes their build.
Work it out on paper first. Then check it on the stage.