Learning Goals 3 min
By the end of this lesson you will be able to:
- Use the Make a List button in the Variables palette and choose between For all sprites and For this sprite only — the same rule you already know from variables.
- Identify the list watcher on the Stage and add a couple of items by hand using the + button at the bottom of the watcher.
- Tell the difference between a variable reporter (one value) and a list reporter like (shopping) (all items joined together, for display only).
Warm-Up — one box vs many boxes 7 min
In L03-06 you learned what a list is. Quick check before we make one.
Aunty Siti is going to the pasar. She writes kangkung on a sticky note, then realises she also needs tauhu, cili, and bawang. She has two choices:
- Plan A: four separate sticky notes, one for each thing.
- Plan B: one notepad page with four lines on it.
Which plan is more like a Scratch variable, and which is more like a Scratch list?
Reveal the answer
Plan A is four variables. Each sticky note holds exactly one thing and you have to name each one separately (item1, item2, item3, item4). Plan B is one list — a single named container (shopping) that holds many items, numbered automatically (1, 2, 3, 4). When Aunty Siti remembers a fifth thing, Plan B just gets a new line. Plan A needs a fifth sticky note and a fifth variable name. Lists scale; variables don't.
Today we build Plan B in Scratch — and the moment you click "Make a List", something visible pops onto the Stage that you've never seen before.
New Concept — the Make a List button 15 min
Up to now, when you wanted a new container for data you opened the orange Variables palette and clicked Make a Variable. Lists live in the same palette, just one button down.
Where to find it
Open the Variables palette. Scroll past the variable section. You'll see a second button labelled Make a List:
[ Make a Variable ]
[ Make a List ]
Click Make a List. A small window pops up asking for the list name and one more question.
The "For all sprites" question
You've seen this question before — it's the exact same one Scratch asks when you make a variable.
- For all sprites — every sprite in the project can read and change the list. Choose this for a shared shopping list, a high score, a guest list.
- For this sprite only — only the sprite you're currently working on can use the list. Choose this for things that belong to one character — a wizard's spellbook, one player's hand of cards.
Most of Level 3 will use For all sprites, because we're learning how lists work, not how to hide them. Pick that one for now.
The list watcher appears
The moment you click OK, something new appears on the Stage — the list watcher. It looks like a small notepad with the list name at the top, empty space in the middle, a number counter at the bottom-left, and a + button at the bottom-right.
shopping
1 kangkung
2 tauhu
3 cili
length: 3 [ + ]
Compare it to a variable watcher, which is just a tiny rounded label like score: 0. Variable watchers are small because they hold one value. List watchers are tall because they have to show many rows.
Editing by hand
You can fill the list without writing any blocks at all. Click the + at the bottom of the watcher. A new blank row appears. Type kangkung. Hit enter. Click + again. Type tauhu. And so on. This is the same as writing items on a notepad by hand — useful for testing, but not how a real program fills a list (that comes next lesson).
Reading the name vs reading the contents
Here's the part that surprises people. When you make a variable called score, Scratch gives you a block (score) that reports the value (e.g. 0). When you make a list called shopping, Scratch gives you a block (shopping) that reports… all the contents joined together with spaces.
when flag clicked
say (shopping) for (3) seconds
kangkung tauhu cili — the whole list, smushed together.This is for display only. It's handy when you want to peek at the list quickly, but most of the time you'll read items one at a time with item (1) of [shopping v] — and that's lesson L03-09.
Show and hide
Just like variable watchers, you can show and hide the list watcher from inside a script:
show list [shopping v]
hide list [shopping v]
Worked Example — Aunty Siti's pasar list 12 min
Open Scratch. We'll make one list, fill it by hand, and show it on the Stage with a button.
shopping watcher sits top-left; the cat (the sprite you script — see the ✏️ badge) shows the list and reads it aloud. This lesson the script just makes and displays the list; later lessons add Find and Sort buttons.Step 1 — Start fresh
New Scratch project. Keep the default cat. We won't need any other sprites today.
Step 2 — Open Variables
Click the orange Variables palette in the block menu on the left.
Step 3 — Click Make a List
Click the second button, Make a List. The pop-up appears.
Step 4 — Name it shopping
Type shopping as the list name. Leave the radio button on For all sprites. Click OK.
Step 5 — Look at the Stage
A tall notepad-shaped watcher appears at the top-left of the Stage with the word shopping at the top and an empty body. length: 0 shows at the bottom.
Step 6 — Add three items by hand
Click the + button at the bottom-right of the watcher. A blank row appears. Type kangkung. Hit enter. Click + again, type tauhu. Click + again, type cili. The length now reads 3.
Step 7 — Make the cat read the whole list aloud
From Events: when ⚑ clicked. From Looks: say () for (2) seconds. From Variables: drag the (shopping) reporter into the round slot of the say block.
Step 8 — Run it
Click the green flag. The cat says kangkung tauhu cili for two seconds. That's the whole list, displayed as one glued-together string. Good for a quick peek, not for a real shopping app.
The full assembled stack
when flag clicked
show list [shopping v]
say (shopping) for (2) seconds
What you just built: the smallest possible list-based project — a container with three items in it and a way to display them. Every list-driven thing you'll build in this cluster — quiz banks, score tables, NPC dialogue queues — starts from this same setup.
Try It Yourself — three list-creation drills 15 min
Goal: Make a new list called friends (For all sprites). Use the + button to add four names of real friends. Then make the cat say the whole list when the flag is clicked.
when flag clicked
say (friends) for (3) seconds
Think: If you had used variables instead, you'd need four separate variable names — friend1, friend2, friend3, friend4 — and a different say block for each. One list, one say block. That's the win.
Goal: Make a list called jobs. Add three chores by hand: sapu rumah, basuh pinggan, buang sampah. Then build a script with two hats: one shows the list when the space key is pressed, the other hides it when the h key is pressed.
when [space v] key pressed
show list [jobs v]
when [h v] key pressed
hide list [jobs v]
Think: The list itself doesn't disappear when you hide the watcher — only the on-screen widget vanishes. The data is still in there. Press space again and it pops right back.
Goal: Make two sprites. Give the cat a For all sprites list called team with three names. Give a second sprite (any costume) a For this sprite only list called secret. Then check: can the cat see the second sprite's secret list in its block menu? Why or why not?
when flag clicked
say (team) for (2) seconds
team is for all sprites. Try dragging (secret) onto the cat and you'll find it isn't even in the menu.Think: Lists made For this sprite only are invisible to other sprites — even in the block menu. That's the whole point of the option. Useful for keeping one character's inventory private from another.
Mini-Challenge — the bingo card that won't reset 5 min
"Hafiz's bingo numbers"
Hafiz wants a list called bingo that shows on the Stage whenever the flag is clicked, with five numbers he typed in by hand (7, 14, 22, 31, 45). He writes this:
when flag clicked
hide list [bingo v]
show list [bingo v]
say (bingo) for (2) seconds
Mentally click the flag. What does Hafiz actually see, and what should he change?
Reveal one valid solution
The hide-then-show pair runs so fast Hafiz won't even see the flicker — that's fine. The real problem is the order: hide first then show works, but it's noise. The bigger thing is Hafiz expected (bingo) to say "7, 14, 22, 31, 45" with commas. It actually says 7 14 22 31 45 — spaces, no commas. The list reporter joins items with single spaces, always. There's no option to change that.
If Hafiz needs commas (for a bingo display), he'll need item (1) of [bingo v] + glue + comma + the next item — and that's lesson L03-09. For now the cleaner version of his stack is just:
when flag clicked
show list [bingo v]
say (bingo) for (2) seconds
Two blocks. Hide isn't needed if you never hid it. The lesson: the list reporter is for quick peeks, not for pretty output.
Recap 3 min
You made your first real Scratch list. The Make a List button lives in the Variables palette, right below Make a Variable. You pick a name and choose For all sprites or For this sprite only — same rule as variables. The moment you click OK, a tall notepad-shaped list watcher appears on the Stage, with numbered rows and a + button for adding items by hand. The list-name reporter (shopping) reports all items joined with spaces, which is handy for peeking but not for proper output. Next lesson we stop typing items by hand and start adding them with a block.
- List
- A named container that holds many items in numbered order. The Scratch version of a notepad page (vs a variable's single sticky note).
- List watcher
- The tall widget that appears on the Stage when you make a list. Shows the list name, every item with its index number, the length, and a + button to add items by hand.
- For all sprites / For this sprite only
- The same scope question Scratch asks for variables. All sprites means every sprite can read and change the list; this sprite only means only the current sprite can.
- List reporter
- The round (shopping) block that reports all the items of the list joined with spaces. Display-only — use item (1) of [shopping v] when you want one item at a time.
- show list / hide list
- show list [shopping v] and hide list [shopping v] turn the on-Stage watcher widget on and off. The list data is unaffected either way.
Homework 2 min
The Three-List Pantry. Build one Scratch project with three different lists in it.
- List 1:
sayur(For all sprites). Add four vegetables by hand using the + button — e.g.kangkung,bayam,sawi,kobis. - List 2:
buah(For all sprites). Add four fruits — e.g.pisang,mangga,rambutan,durian. - List 3:
rahsia(For this sprite only — on the cat). Add three secret words. Test that another sprite can't see this list in its block menu.
Build one script on the cat: when ⚑ clicked + say (sayur) for (2) seconds + say (buah) for (2) seconds + say (rahsia) for (2) seconds. The cat should read all three lists in a row.
Save as HW-L3-07-Three-Lists.sb3.
Bring back next class:
- The
.sb3file. - Your answer to: "When you said (rahsia), what did you actually see? Could you tell where one secret ended and the next began? Why is that a problem?"
Heads up for next class: SCR-L03-08 introduces add [item] to [shopping v] — the block that lets a script put things in the list instead of you typing them by hand. We pair it with ask () and wait to build a "type a thing, hit enter, it's in the list" mini-app.