Today you will use a Scratch list to save items in order, then take them back — for undo and order replay.
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-AP-11 · CSTA 2-AP-13 · ISTE 1.5.c · Standards
| 🎯 I can | use a Scratch list to save items in order, then take them back — for undo and order replay |
| 📝 New words | 7 words |
| ⏱ Lesson time | ~45 min |
Teacher Guide
📋 Before class
⚠️ Common misconceptions
- Students take item 1 for both jobs. To undo, take the LAST item (the newest move). To replay messages in order, take the FIRST item. The difference is which end you take from.
- Students try to make a custom block hand back a value. A Scratch custom block cannot hand back a value — use a
resultvariable that the caller reads after the block runs. - Students forget the empty case. The take block checks length > 0 and sets result to EMPTY; the caller must still check result before using it.
🎯 Differentiation
🐢 Struggling: Build only the take-last (undo) blocks first. Use the list monitor to watch add and remove in slow motion. Add the message replay only after take-last is clear.
🚀 Advanced: Add a redo list so R brings back a move that U took away, and clear the redo list when a new move is saved.
💡 During the lesson
- Warm-UpBefore the lesson, show the idea with books. Add 5 books to a pile, one at a time — each
addputs one on top. Now take one back: you grab the top (last) book first, because it is the newest. That is exactly how undo works — the last move you made is the first one taken back. Then line up 5 students; the one who lined up first goes first. Two simple rules: take the last, or take the first. Today's list does both. - Try ItThe key visual: draw the list as a row of boxes on the board — new items join the end. To undo, take from the END (the newest). To replay in order, take from the FRONT (the oldest). Both use the same Scratch list; only the end you take from changes the behavior.
The third experiment is critical. When item (length of [empty list]) is called, Scratch returns an empty string. Theresultvariable will be empty, not an error. This is a silent failure — the program keeps running but gives a wrong value. Students who say "nothing bad happens" need to be challenged: "What if your undo takes from an empty list — what move does it try to take back?" - PlanThe core build saves only the x position (1D undo) —
add_last (x position)stores one number, and undo glides back tox:(result) y:(-80). This keeps Part B simple enough for every student. Advanced only: for a 2D undo, keep two lists —saved_xandsaved_y— and add to both on every move. Do not require this of the whole class — it is offered as an Extend challenge (🟡 full position saver). - BuildStep 10's script has an intentional extra take to show the EMPTY result. Students who are confused can count: 3 added, then 4 taken — the 4th must return EMPTY. This shows why an empty check matters in real systems.
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.