← Semester 2

IT · Sem 2 · Chapter 3

Done
IT · Semester 2 · Chapter 3 · Grade 8 (M.2)

Problem Solving with Scratch 🧱

The same ideas as Chapter 2 — reusable blocks, boolean conditions, and passing values in — but built by snapping shapes together instead of typing syntax.

🕶️ with Guru Jazzy

🎯 What you'll unlock this lesson

  • Build a custom block ("My Block") to reuse a sequence of actions
  • Use Scratch's comparison and boolean blocks in a condition
  • Pass values into a custom block through its inputs

🍉 Custom blocks 3.1

In the watermelon-cutting game, every slice repeats the same three actions: play a "chop" sound, split the sprite in two, and add a point. Instead of stacking those three blocks every single time a slice happens, Scratch lets you define your own block — a custom block — that bundles them under one name.

KEY TERM · Custom block ("My Block") — a block you define yourself in Scratch that bundles a sequence of other blocks under one reusable name.

❌ Without a custom block

Every slice event repeats the same 3 blocks — copy, paste, copy, paste...

when this sprite clicked
play sound chop
split sprite in two
change score by 1

✅ With a custom block

Define it once, then just call it by name everywhere it's needed.

when this sprite clicked
cut watermelon
define cut watermelon
play sound chop
split sprite in two
change score by 1

Same benefit as a Python function: define once, reuse everywhere, and if the behaviour needs to change, there's only one place to edit it.

🔤 Boolean blocks 3.2

Scratch's hexagon-shaped blocks are booleans — they slot into the diamond-shaped holes of if blocks. Comparison blocks (<, =, >) and boolean blocks (and, or, not) work exactly like Python's — just shaped differently.

when green flag clicked
if < score > 10 > then
say "You win!"

🎮 Interactive Condition Builder signature move

Set two numbers and an operator, then combine two comparisons with and / or — just like snapping boolean blocks together. Watch the result update live.

A =B =
C =D =

🎮 Passing values into a custom block 3.3

A custom block can have its own inputs ("my blocks with parameters") — round or hexagon slots added when you define the block, filled in differently each time it's called.

Definition (with an input)

define cut watermelon points
play sound chop
split sprite in two
change score by points

Two calls, two different results

cut watermelon 1

→ score increases by 1 (a normal slice)

cut watermelon 5

→ score increases by 5 (a golden watermelon!)

🐍 Same idea, Python side by side

ScratchPython equivalent
define cut watermelon (points)def cut_watermelon(points):
change score by (points)score += points
cut watermelon (5)cut_watermelon(5)

The input on a "my block" is exactly a parameter — same concept as Chapter 2, different notation.

🍚 Activity — Aunt Cherry's fried basil chicken rice boxes

Aunt Cherry sells 15 boxes of fried basil chicken rice per batch. Enter the total ingredient cost for one batch, and this calculator works out the per-box price and a price that gives a 30% profit — exactly what the textbook activity asks you to compute by hand.

📋 More end-of-chapter activities

  • 1️⃣ Survey classmates on which programs/apps they use for searching, browsing, and staying safe online.
  • 2️⃣ Record classmates' height, weight, and gender, then compute the class average and the average per gender.
  • 3️⃣ Plan a village New Year celebration event using the computational-thinking pillars from Chapter 1.
  • 4️⃣ Design a simple student-data recording program (name, ID, grade).
  • 5️⃣ Aunt Cherry's costing activity — see the calculator above.

🧠 Mini-quiz — no cap, prove it

Guru Jazzy 🕶️ · Sem 2 · Chapter 3 · Problem Solving with Scratch