Learning Goals 3 min
By the end of this lesson you will be able to:
- Recognise the hexagonal shape on sight and explain that it always means a block that reports true or false.
- Name at least six hexagonal reporters from across the Sensing, Operators, and (later) Variables palettes — and predict the only kind of slot they fit into.
- Explain why Scratch physically refuses to let you drop a round block into a hexagonal slot, and why that refusal is a kindness, not a bug.
Warm-Up — three blocks, three shapes 7 min
Aisyah is teaching her younger brother Daniel about Scratch. She holds up three blocks and asks him to sort them by shape.
(x position)
<touching [edge v] ?>
move (10) steps
Look at each block carefully. What shape is the outline of each one? And — based on shape alone — what kind of slot would each one fit into?
Reveal the answer
- Block A — round (oval). It reports a number. It fits into round slots, like the white circle inside move ( ) steps.
- Block B — hexagonal (six-sided). It reports true or false. It fits into hexagonal slots, like the diamond inside if <> then.
- Block C — jigsaw-shaped (a stack block). It does an action but reports nothing. It clicks into the top or bottom of other stack blocks.
Three blocks, three shapes, three jobs. The shape is the protocol.
Today's lesson is a tour of the hexagonal family — every six-sided block you have met or will soon meet — and one big idea: Scratch uses the shape to physically stop you from making mistakes.
New Concept — the hexagonal family 15 min
In Scratch every block has a shape. The shape tells you, at a glance, what the block does. Hexagons are the six-sided members of the family, and they all have one job in common: they answer a yes-or-no question. Computer scientists call those answers booleans — true or false. Two values, no in-between.
What a hexagon looks like
A hexagonal block has slanted sides on the left and right, like a stretched diamond. You cannot snap it onto the top or bottom of a stack. It only fits into a matching hexagonal hole inside another block — like the diamond slot in if <> then or the diamond slot in repeat until <>.
if <> then
end
The hexagonal family — the ones you have met
By the end of L02-08 you have already used these hexagons. Let's line them up.
<touching [edge v] ?>
<key [space v] pressed?>
<(x position) > (0)>
<(score) = (10)>
Each one is a question with a yes-or-no answer. Each one is a hexagon. Each one fits into a hexagonal slot — and nowhere else.
More hexagons you will meet soon
You have not used these yet, but they are coming in the next few lessons. They all share the same shape, so you already know how to use them: drop them into a hexagonal slot.
<touching [Ball v] ?>
<mouse down?>
<key [right arrow v] pressed?>
The shape is the protocol
This is the big idea of today's lesson, and one of the kindest things Scratch ever does for you. Imagine if every slot in Scratch accepted any kind of block. You could drop x position (a number) into the diamond slot of if <> then. Scratch would have to decide: is the number 0 false? Is 42 true? Is −1 true? What about 0.5?
That's confusing. So Scratch's designers said: different shape, different job. A round block reports a number. A hexagonal block reports true/false. A diamond slot accepts only hexagonal blocks. If you try to drop a round reporter into a diamond slot, the diamond stays empty and the round block bounces away. The shape physically prevents the mistake.
Watch the refusal
Try this right now in Scratch. Take any if-then block. Drag x position from Motion onto its diamond slot.
if <> then
end
Now do the opposite. Drag touching [edge v]? onto that same diamond slot. It snaps in instantly. The shapes match — they're meant for each other.
Worked Example — tidy the seeker's hexagons 12 min
Back to Hot or Cold. The seeker measures distance, but let's be sure every test in its diamond slots is a real hexagon. We line up each test, name its parts, and confirm the shape. Open your saved project.
Step 1 — Open the project
Open your Hot or Cold project. Click the seeker. Find its distance tests in the forever loop.
Step 2 — Spot the round block
Look at distance to [treasure v] on its own. It is a round oval. It reports a number, never a yes/no answer — so it could never sit in a diamond by itself.
Step 3 — See the wrapper
Now look at the whole test: () < () with the distance reporter inside. The outer outline is a hexagon. The round reporter lives inside the green comparison:
<(distance to [treasure v]) < (60)>
Step 4 — Check both heat tests
Confirm both of the seeker's tests are hexagons: the HOT test (< 60) and the warm test (< 150). Each wraps the same round reporter in a comparison.
Step 5 — Try the refusal
Drag a bare distance to [treasure v] onto a diamond slot. Scratch refuses — the slot glows and the round block bounces away. Shapes do not match.
Step 6 — The tidy seeker stack
when flag clicked
forever
go to [mouse-pointer v]
if <(distance to [treasure v]) < (60)> then
say [HOT!] for (0.5) seconds
end
if <(distance to [treasure v]) < (150)> then
say [Warmer!] for (0.5) seconds
end
end
Step 7 — Click the flag and confirm
Drag the seeker toward the treasure. Both messages still fire correctly. Nothing changed on screen — but you now know why each test is allowed in the diamond.
What you just built: the confidence to read any test by its shape. A number is round; a yes/no answer is a hexagon; only hexagons fit the diamond. That single rule explains every snap and every refusal in the seeker's code.
Try It Yourself — three hexagon drills 15 min
Goal: Sort the hexagons. Open the Scratch block palettes for Sensing, Operators, and Motion. Find three hexagonal blocks and two round blocks. Write them down in your notebook in two columns. (Hint: every block in Operators with the symbols =, >, or < is a hexagon.)
<touching [edge v] ?>
<key [space v] pressed?>
<(x position) = (0)>
Think: If a block has rounded corners that look like an egg, it is a number reporter, not a boolean. The slanted six-sided shape is the giveaway.
Goal: Build a tiny "double sensor". One cat sprite, one forever loop, two if-then blocks inside. The first uses key [up arrow v] pressed? to change y by (10). The second uses key [down arrow v] pressed? to change y by (-10). Click the flag and tap up/down to move the cat vertically.
when flag clicked
forever
if <key [up arrow v] pressed?> then
change y by (10)
end
if <key [down arrow v] pressed?> then
change y by (-10)
end
end
Think: Both questions use the same hexagonal reporter — key [ v] pressed? — just with different dropdown choices. One block shape, many uses.
Goal: A "stay in bounds" guard. Use a hexagonal comparison from Operators to keep the cat from leaving the right half of the Stage. If x position ever becomes less than 0, snap the cat back to x: 10. Use () < () as your hexagon.
when flag clicked
forever
if <(x position) < (0)> then
set x to (10)
end
end
Think: The hexagonal block here is built from two round blocks plus an operator. The whole assembly is still hexagonal because () < () is the wrapper. Look at the outline — it's six-sided.
Mini-Challenge — the impossible plug 5 min
"Priya's broken script"
Priya wants the cat to say "Hi!" only when the cat is in the upper half of the Stage. She tries to plug y position directly into the diamond slot of an if-then:
when flag clicked
forever
if <> then
say [Hi!] for (0.5) seconds
end
end
Why won't it snap? And what should Priya do to make her idea work?
Reveal one valid solution
y position is a round reporter — it reports a number, like 87 or −40. The diamond slot wants a hexagon — a true/false answer. The shapes are different on purpose: Scratch will not let a number stand in for a yes/no question, because a number is not a question.
Priya needs to wrap the round reporter in a hexagonal comparison. The upper half of the Stage is anywhere y is bigger than 0, so the right hexagon is () > () with y position on the left and 0 on the right:
when flag clicked
forever
if <(y position) > (0)> then
say [Hi!] for (0.5) seconds
end
end
Same idea, correct shape. The round y position now lives inside the hexagonal () > (), and the whole assembly is hexagonal — so the diamond slot accepts it. Shape is the protocol.
Recap 3 min
Today you stepped back and looked at a whole family of blocks rather than learning a single new one. The hexagonal shape always means boolean reporter — a block that answers a yes/no question. Hexagons live across at least three palettes: Sensing (touching/key/mouse questions), Operators (comparisons and — coming next lesson — logic combinators), and Variables (a few list questions you'll meet later). Every hexagon fits into every hexagonal slot, and only into hexagonal slots. Scratch uses the shape itself to stop you from plugging numbers into yes/no holes. That refusal is not a bug — it's the language doing its job.
- Hexagon (boolean shape)
- A six-sided block outline. Always means the block reports true or false. Always plugs into a matching hexagonal slot, never on top of a stack.
- Boolean
- A value that is either true or false — nothing else. Named after George Boole, the mathematician who first studied true/false logic.
- Reporter
- A block that reports a value when asked. Round reporters report numbers or text; hexagonal reporters report booleans. Reporters never run on their own — they sit inside other blocks' slots.
- Shape-coding
- The Scratch design choice to give different block types different physical outlines so they can only connect in valid ways. The shape of a block is a tiny built-in safety check.
- Slot (diamond slot)
- The hexagonal hole inside blocks like if <> then, repeat until <>, and wait until <>. Only boolean reporters fit.
Homework 2 min
The Hexagon Hunt. Open a brand-new Scratch project. Build a "diagnostic dashboard" sprite that uses five different hexagons in one forever loop.
- Drop a cat sprite. Add when ⚑ clicked and a forever.
- Inside the forever, add five separate if <> then blocks.
- Fill each diamond with a different hexagonal reporter — your five must include at least two from Sensing and at least two from Operators.
- Inside each if-then C, put a say [ ] for (0.5) seconds with a different message naming which hexagon fired (e.g.
say [Touching edge!],say [Y is high!]). - Click the flag. Push the cat around the Stage. Make at least three of the five messages appear during one run.
Save as HW-L2-09-Hexagon-Hunt.sb3.
Bring back next class:
- The
.sb3file. - Your written list of all five hexagons you used and which palette each came from.
- Your answer to: "Why can't you drop the round block size into a diamond slot? Explain in your own words."
Heads up for next class: SCR-L02-10 meets the three combinator hexagons from Operators — <> and <>, <> or <>, and not <>. They take hexagons as inputs and report hexagons. Hexagons all the way down.