Intermediate
60 mins
Teacher/Student led
+85 XP

Algorithms and Debugging: Unplugged to Sequenced

Pupils write precise step-by-step instructions for real tasks and identify unnecessary detail. They find and fix a deliberate bug in another group's algorithm. Finally they build and debug a sequenced robot route within a step limit.

Teacher Class Feed

Load previous activity

    1 - Getting Started ~5 mins

    Illustration for Getting StartedTraffic lights, a cake recipe, a bus-stop announcement: each one follows a fixed order of steps. What happens if one step is missing or in the wrong place?

    Today we write precise step-by-step instructions, break one on purpose, find the bug, and fix it. Then we try the same thinking on a robot route on the board.

    2 - Precise Steps, Bugs and Fixing Them ~8 mins

    Illustration for Precise steps, bugs and fixing themWatch how I write steps for watering the classroom plant. Which details would you keep, and which would you leave out?

    Key point

    Those ordered steps are an algorithm. When a step is wrong or missing, that mistake is a bug. Finding the mistake, fixing it, and testing again is debugging.

    3 - What Details Matter? ~7 mins

    Look at the classroom task on the board. With your group, call out steps you would keep and steps you would leave out. Be ready to say why.

    4 - Write, Break and Fix ~18 mins

    Quick class vote first: which change is most likely to make a job fail — a missing step, steps in the wrong order, or a wrong direction? (An extra step that does nothing is usually clutter, not a bug.)

    Your group has one task card. Work through these jobs in order:

    1. Write a clear algorithm on the step cards (5 to 8 steps).
    2. Test: one person follows the steps exactly while the others watch.
    3. Break exactly one step so the job fails.
    4. Swap card packs with the group you are paired with.
    5. Find and fix their bug.
    6. Test again to check the fix works.

    5 - Record the Algorithm and the Fix ~8 mins

    On your Investigation Journal page, record four short notes like the board example. Keep each note to one or two lines: your group's steps, the bug you found, the fix that worked, and one detail you left out on purpose.

    Pupil practice · Investigation Journal
    Module 4 · Technology: Inputs, Algorithms and Coding on Devices
    Lesson 24 · Algorithms and Debugging: Unplugged to Sequenced
    Download Investigation Journal sheet (PDF)
    123learn · Online learning platform

    Unlock the full learning experience

    You're previewing this lesson. Get full access to this lesson and hundreds more — each one ready to teach, with interactive activities, printable resources and pupil progress tracking built in.

    Hundreds of curriculum-aligned lessons
    Interactive activities in every lesson
    Printable resources & progress tracking
    Copyright Notice
    This lesson is copyright of Coding Ireland 2017 - 2025. Unauthorised use, copying or distribution is not allowed.
    🍪 Our website uses cookies to make your browsing experience better. By using our website you agree to our use of cookies. Learn more