Loops, Decisions & Debugging
Loops, conditions, sensing, variables, bugs and a clean-up mini-game.
⌨️ Start with your 10-minute typing warm-upBy the end, you will be able to:
- Explain the difference between a counted loop (
repeat (10)) and an infinite loop (forever), using the fufu pounding analogy. - Use an
if <> thenblock with a diamond-shaped sensing block such astouching [mouse-pointer]?. - Create a Score variable, reset it with
set [Score] to (0)and change it withchange [Score] by (1). - Follow the 3-step debugging protocol: Spot it, Trace it, Fix one thing.
- Save a working game as
Cleanup_Game_[Name].sb3.
What you need
No computer at home? Print the PDF and practise on paper.
Follow these steps in order
Tick each step when you finish it. Your ticks are saved on this device, so you can stop and come back later.
Learn the ideas ⏱️ 35 min
Read pages 1–4 of the workbook and try every small task. Type your answers straight into the boxes: they save by themselves.
Explore the 3D lab ⏱️ 15 min
Play with the 3D model below. The 🎯 missions tell you exactly what to do next. When you finish every mission, this step ticks itself.
Do the Lab Mission ⏱️ 25 min
Page 5 is the hands-on task. Do it on a real computer, step by step. You need: Scratch (online at scratch.mit.edu or the offline app).
Check yourself ⏱️ 10 min
Answer the questions on page 6 without looking back, then check your answers below.
Finished? Check your answers
1. "Be the Computer" Logic Tracing Challenge: Final Score value = 25 (10 + 5 + 5 + 5 = 25).
2. Spot the Bug Challenge: Kwesi forgot
set [Score] to (0), placed underwhen green flag clickedat the top of his script, so the score resets every new game. Accept "set Score to 0" or "the reset block".Rate yourself and save your work ⏱️ 5 min
Tick how confident you feel on the last page, then press 🖨 Print / Save as PDF in the workbook to keep a copy. On a shared computer, press Clear my answers when you have saved it.
🎉 Session 17 complete!
Brilliant work. Next up: Session 18: What Is AI? Machines That Learn.
Go to Session 18 →🤖 Code the Sprite
Snap together motion, loop and pen blocks, run them on an x/y stage, collect litter for points and debug step by step. Follow the 🎯 missions on the right: they tell you what to do next.
Stuck? Try this
Most problems are one missed word. Look for the Panic Button or Help box in the workbook.
Refresh the page. On a very old computer it may not show 3D. The workbook still has everything you need.
Answers save on the computer you typed them on. Open the workbook on that same computer and browser.
Ask your mentor, a teacher or a friend. Show them the step number you are on.
Going somewhere without internet? Download this session's study pack (workbook, PDF and README). Last updated 30 October 2026.