Skip to the page
Year 7 · Summer 1 · Scratch II: Subroutines and lists

Decomposition and subroutines (My Blocks)

PracticalPresent ▶

What this lesson covers

Topic 11 Algorithms

KS3 Computing · An algorithm is a precise, step-by-step plan to solve a problem. Computational thinking turns a messy problem into one. Every algorithm is built from just three things: sequence, selection and iteration.

Computational Thinking ProgrammingCambridge Lower Secondary Computing 0860

You will learn to

  • Use decomposition to break a maze game into smaller parts.
  • Create a My Block that does one job.
  • Explain why calling a My Block twice is better than copying the same blocks twice.

Success criteria

  • I can list at least four parts of a maze game.
  • I can make a My Block and use it in two places.
  • I can give one reason why subroutines make code easier to fix.

Key words

Say each word, then read what it means. Every one is in the glossary too.

Sequence
Steps run in order, one after another.
Selection
Choosing a path with if / else.
Iteration
Repeating steps: a loop.
Algorithm
Precise, ordered, finite steps to solve a problem.
Decomposition
Breaking a problem into smaller ones.
Abstraction
Ignoring detail that doesn't matter for the problem.
Sequence · selection · iteration
Steps one after another. First this, then this.
Pseudocode
Code-like writing for algorithms, without strict rules.
Trace table
Records variable values step by step to check logic.
Variable
A named place in memory that holds a value.

The explanation

Read it here, or open the study page below to go one step at a time with things to try.

The three building blocks

BlockMeaningEveryday example
SequenceSteps in orderSocks, then shoes
SelectionChoose a path (if… else…)If it rains, umbrella; else sunglasses
IterationRepeat (loops)Stir 20 times; or stir until smooth
★Remember

Count-controlled loops repeat a set number of times. Condition-controlled loops repeat until something is true.

Study it

Open the study page and go one step at a time.

Check yourself

One question at a time. The reason shows after each answer.

Saved on this device.