Sequences of instructions
Produce & execute a sequence of instructions coding a displacement (unplugged or robot); interpret simple algorithms.
An algorithm is a list of instructions, given in order, that you follow one step at a time to get a job done. This concept is about writing such a list to move something from a start to a finish — and about reading someone else’s list to work out where it leads.
What it means
A sequence of instructions is exactly what it sounds like: step 1, then step 2, then step 3, carried out in that order. Each instruction is a single, unambiguous command — something you could not misread. To move a person, robot or drawing-pen across a floor or grid, the instructions describe a displacement: a change of place. Two kinds of command are enough:
- a move — go forward one square (or a fixed distance);
- a turn — rotate on the spot, usually a quarter turn (a right-angle) left or right.
Chaining these gives a route. Because you execute the list top to bottom, order matters: “forward, then turn right” lands you somewhere different from “turn right, then forward”. Swap two steps and the ending place usually changes.
Two skills sit together here. Producing an algorithm means writing the steps that achieve a goal you have in mind — planning a path in advance. Interpreting one means being handed the steps and figuring out the result without moving yet — running the program in your head. Doing this away from any computer (“unplugged”), with a friend walking the route or a counter hopping across squares, is just as valid as using a robot or an app; the thinking is identical.
An instruction is only useful if it is precise. “Go over there” is not an instruction; “forward, forward, quarter turn right, forward” is.
Worked examples
1. Read a route. Start at the bottom-left of a grid, facing up. Follow:
forward
forward
turn right
forward
You end two squares up and one to the right, now facing right. You have traced an L.
2. Order changes everything. From the same start:
| Program | Ends facing | Ends at |
|---|---|---|
| forward, turn right | right | 1 square up |
| turn right, forward | right | 1 square right |
Same two instructions, different results — because the order differs.
3. Write a route. Goal: draw a square, 3 squares per side. The plan is one instruction pair repeated four times: forward ×3, turn right. Run it four times and the pen returns to its start.
The generative-art connection
A drawing is just a route that a pen leaves behind. Steer a turtle — a pen you drive with forward and turn commands — and the picture is your algorithm made visible. forward, turn repeated with a quarter turn closes into a square; a fifth of a turn gives a pentagon; a small, deliberately imperfect turn spirals outward. Change one number in the instruction list and the whole shape changes, so children see cause and effect in the art itself.
dot-multiplier shows the same idea as pure repetition: one instruction — “place a dot, rotate a little” — run over and over builds a symmetric starburst. The count of steps you sequence is the count of arms you see. Turtle Blocks, ScratchJr and Blockly Games — Maze let a learner drag those steps into order and watch them run.
Common misconceptions
- Order is not optional. The same instructions in a different sequence usually give a different result — a route is not just a bag of moves.
- A turn is not a move. Turning changes which way you face but keeps you on the same square; it only affects where the next forward goes.
- Instructions must be exact. A step a person could interpret two ways is not a valid instruction — a robot would freeze, and a friend would guess.
What a learner should be able to solve
The benchmark for mastering this concept — the problems a child at this stage is expected to be able to work through.
-
You are given a start and a goal on a square grid. Write a precise sequence of `forward` and `turn` instructions that moves a robot from start to goal, using only single moves (forward one square) and quarter turns (left or right). Show that your list works by reading it back step by step and landing exactly on the goal. Example goal: start bottom-left facing up, finish `3` squares up and `2` squares to the right.
Answer
A correct list, e.g. `forward, forward, forward, turn right, forward, forward`. Reading it back: `3` squares up (still facing up), quarter turn right (now facing right), `2` squares right — lands exactly on the goal. Any valid ordered list that traces start to goal counts; the child must be able to execute it and land exactly on the target.
Art hook Grid path-painter on Canvas 2D: the child types a list of forward/turn tokens; a dot walks the grid leaving a coloured trail, one segment per `forward`, turning 90 degrees per `turn`. Correct arrival flashes the goal cell gold.
-
Here is a program for a robot that starts at the bottom-left of a grid, facing up: `forward, forward, turn right, forward, turn right, forward` Without moving anything, work out in your head where it ends and which way it is facing.
Answer
Ends `1` square up and `1` square right of the start, facing down. Trace: `2` up (facing up) → turn right (facing right) → `1` right → turn right (facing down) → `1` down. Net vertical: `2` up then `1` down = `1` up; net horizontal: `1` right. Final facing: down.
Art hook Head-run visualiser: show the program as text, let the child predict the end cell by clicking it, then animate the turtle to reveal whether the prediction matched — a self-checking maze.
-
Explain, in your own words and with an example, why the order of instructions matters. Give two short programs that use the very same instructions but end in different places.
Answer
Because you execute the steps in order, changing the order changes the route. Example (start facing up): `forward, forward, turn left` ends `2` squares up, facing left; `turn left, forward, forward` ends `2` squares left, facing left — same three instructions, different endings. Any correct pair that keeps the same instructions but reaches different squares counts.
Art hook Two turtles run side by side on identical grids, one for each ordering of the same instruction bag; their trails split apart at the first difference — a visual proof that order matters.
-
A friend wrote this instruction to guide a robot across the floor: "Go over near the window." Explain why this is not a good instruction for a robot, then rewrite the plan as a precise sequence a robot could actually follow.
Answer
It is ambiguous — the robot cannot measure "near" or "over" and does not know how far to go or which way to turn, so it would freeze or guess. A precise version uses exact single commands, e.g. `forward, forward, turn left, forward`. Any exact, unambiguous ordered list is accepted.
Art hook Ambiguity-vs-precision toggle: type the vague phrase and the turtle shrugs and stays put; type an exact token list and it walks the route — the child sees why precision is required.
Training exercises
Practice problems, easier first, that build toward the bar above. Each doubles as a seed for an interactive artwork.
-
An algorithm is a list of steps done in order to get a job done. Put these steps for making toast in the right order by numbering them `1`, `2`, `3`, `4`: press the lever down; put bread in the toaster; take out the toast; wait for it to pop.
Answer
`1` put bread in the toaster, `2` press the lever down, `3` wait for it to pop, `4` take out the toast. The job only works if the steps run in this order.
Art hook Ordering game: shuffled instruction cards the child drags into a column; when the order is correct a little animation plays the 'job' start to finish.
-
A robot has just two commands: `forward` (move one square ahead) and `turn right` (rotate a quarter turn, staying put). Which of these two commands changes which square the robot is standing on, and which one only changes the way it faces?
Answer
`forward` changes the square it stands on; `turn right` only changes the direction it faces (it stays on the same square).
Art hook Toggle demo: one button for each command; pressing `forward` slides a dot to the next cell, pressing `turn right` spins an arrow in place — the child feels the difference.
-
Start at the bottom-left of a grid, facing up. Follow this program one step at a time and say which square you finish on: `forward, forward, forward`
Answer
You finish `3` squares up from the start, still facing up. Three forwards with no turns just walk straight up.
Art hook Number-line-on-a-grid: each `forward` lights the next cell going up, turning the vertical count into a glowing bar — repeated moves shown as a growing stack.
-
Start at the bottom-left, facing up. Read this program and give the finishing square and the direction faced: `forward, turn right, forward, forward`
Answer
Finish `1` square up and `2` squares right, facing right. Trace: `1` up (facing up) → turn right (facing right) → `2` right.
Art hook Trail-drawing turtle: the path forms an upside-down L; the app colours the vertical part one hue and the horizontal part another so the two moves read clearly.
-
Two programs start at the same square facing up. Program A is `turn right, forward`. Program B is `forward, turn right`. Do they finish on the same square? Say where each one ends.
Answer
No. A ends `1` square to the right (turn first, then step right). B ends `1` square up (step up first, then just turn on the spot). Same instructions, different order, different endings.
Art hook Split-screen: two grids run A and B in sync so the child watches the turtles diverge on the very first difference.
-
Spot the mistake. A child wanted the robot to end up `2` squares to the right of the start (facing up at the start). They wrote: `turn right, forward, forward, forward` What went wrong, and how would you fix it?
Answer
They wrote three forwards instead of two, so the robot ends `3` squares right, not `2`. Fix: remove one `forward` → `turn right, forward, forward`. (It also ends facing right, not up, which is fine since the goal was only about the square.)
Art hook Debug mode: the wrong path is drawn in red overshooting the goal cell; the child deletes a token and the trail redraws until it lands on the gold target.
-
Write a short program that starts at the bottom-left facing up and ends `2` squares up and `1` square to the right. Use only `forward` and `turn right`.
Answer
For example `forward, forward, turn right, forward`: `2` up (facing up) → turn right (facing right) → `1` right. Any ordered list landing on that square is correct.
Art hook Free-build path: child assembles tokens and the turtle walks the grid; the target cell is marked, and a checkmark appears when the trail reaches it.
-
A turtle drawing pen starts facing right and follows this program, drawing a line for each `forward`: `forward, turn right, forward, turn right, forward, turn right, forward` What shape does the finished drawing make?
Answer
A square. Four equal `forward` sides with a quarter `turn right` between each brings the pen back to its start, closing the path — a square.
Art hook Turtle-draws-a-square: run the program and watch four equal sides snap shut; then let the child swap each quarter turn for a fifth-of-a-turn (72 degrees, five sides) and watch a pentagon appear instead.
-
Reasoning challenge. A robot faces up and runs `turn right, turn right`. Which single command would have left it facing the same way?
Answer
There is no single quarter-turn command that does it: two right turns add up to a half turn, so the robot now faces down. To match it in one command you would need a half-turn command; with only quarter turns you genuinely need two steps.
Art hook Rotation dial: an arrow that clicks 90 degrees per turn; the child watches two right-clicks equal one half-turn (down), linking turns to angle.
-
Open-ended maze. Design your own small grid maze on paper with a start, a finish, and one or two walls to go around. Then write the exact sequence of `forward` and `turn` instructions that solves it. Swap with a friend and run each other's programs.
Answer
Any maze with a matching, precise, ordered instruction list that reaches the finish without crossing a wall is a success. The friend running it and landing on the finish is the check.
Art hook Maze-maker: the child paints wall cells, drops a start and finish, then writes a program a turtle runs — walls block movement, so a wrong turn stops the turtle and highlights the bump.
-
A robot's program should make it walk `4` squares straight ahead. Instead of writing `forward` four times, describe in words a shorter way to say the same thing.
Answer
Say "repeat `forward` `4` times" — a repeat (a loop) does the same job with less writing. This is the idea of repetition that comes next after sequences.
Art hook Repeat-counter: a slider sets how many times one `forward` runs; sliding it grows the trail live, previewing the loop idea with a single control.