Hewston Higgins Books and Learning

The Lighthouse Glitch

Six teaching slides

Debug the parcel sorter

Click the text to edit. Use Print and Save as PDF to retain changes; browser edits are not saved automatically.

A new example to investigate

Debug the parcel sorter. This is supplementary fiction, separate from events in the book.

Information we have

A new paper robot sorts shapes. Its instructions say: 1 pick up a shape; 2 if it is round, put it in ROUND; 3 put it in SQUARE; 4 repeat. Test it using one circle, one square and one triangle. No computer or machinery is used.

Words that help

condition: A test that determines what happens next.

branch: A choice of instruction path based on a condition.

debug: Find and correct a problem in instructions.

Try the challenge

Trace what happens to each shape. Identify the ambiguous or incorrect instruction and rewrite the sequence so every shape goes to exactly one suitable basket.

Check and explain

Step 3 is unconditional, so the instructions try to send every shape to SQUARE, including a shape already placed in ROUND.

A corrected branch is: if round, ROUND; otherwise if square, SQUARE; otherwise OTHER. Then repeat with the next shape.

Circle goes to ROUND, square to SQUARE, triangle to OTHER.

Change one condition

Add a rectangle. Decide whether to use OTHER or add a fourth basket, then update both the rule and the labels consistently. Explain which conclusion changes and which does not.