Skip to content

Exact Instructions

A computer does what you said, not what you meant. Write steps so clear that a robot could follow them without guessing.

Class 3 to 5beginner20 min3 lessons1 interactive lab
By the end you will be able to
  • Write a short plan as numbered steps
  • Use words like forward and turn left that mean one action each
  • Find the step that sent a robot the wrong way

Finish first

Lesson 1 of 3

Say exactly what to do

Try telling a friend to make a jam sandwich using only short steps. If you say 'put jam on bread', they might put the jar on top of the loaf. You meant open the jar, spread jam on a slice, but you left that out. A computer has the same problem: it does not fill in gaps.

Good steps are small and unambiguous. 'Forward' means move one square. 'Turn left' means rotate without moving. Each step should do one thing. If you need two things, write two steps.

Open the robot lab beside this lesson and run the Straight line plan. Three forwards, no turns. The robot reaches the flag because every step meant one move.

Interactive lab

Robot planner

Pick a plan, press play, and watch the robot follow each step. When it bumps, find which step was wrong.

Robot planner

Sequences, turns, repeats and choices
The plan
  1. Forward
  2. Forward
  3. Forward
1 / 4

Start

The robot starts here, facing right. The plan has 3 steps. It will follow them exactly, even when that is wrong.

Continue

Lesson 2 of 3

When the plan fails

Run the Find the bug plan in the lab. The robot walks into a wall on the last forward. Nothing is wrong with the robot. Step four told it to move when there was no space.

Debugging is the word for finding that wrong step. You read the plan from the start and ask: after each step, where should the robot be? The first step that does not match reality is the bug.

Try the Turn first plan too. Sometimes you need a turn before a forward. If you only write forwards, the robot never faces the flag.

Continue

Lesson 3 of 3

From robot to program

The robot grid is a toy version of what programs do. Later you will write commands in a language, but the idea stays: a list of instructions, run in order, with no guessing.

Good coders still draw plans on paper before they type. The plan can be boxes and arrows, or a numbered list like the robot lab. The paper version is cheaper to fix than code.

Before you leave this topic, write five steps for brushing your teeth so someone who has never seen a toothbrush could follow them. Count how many details you almost skipped.

Continue

Practice

Work these out yourself

No answer key here on purpose: these are the questions worth thinking through before you move on. Open one and work it out.

0/3 attempted

Assessment

Check your understanding

Answer each question, then read the explanation. That is where the learning is.

0/4
  1. Question 1: Why did the robot bump into the wall in the buggy plan?
    Question 1 / 4

    Why did the robot bump into the wall in the buggy plan?

    Select an option first
  2. Question 2: What makes a good step in a plan?
    Question 2 / 4

    What makes a good step in a plan?

    Select an option first
  3. Question 3: What is debugging?
    Question 3 / 4

    What is debugging?

    Select an option first
  4. Question 4: In the straight line plan, how many forward steps reach the flag?
    Question 4 / 4

    In the straight line plan, how many forward steps reach the flag?

    Select an option first
4 of 4 questions left.

Finished this topic?

0 of 3 lessons marked done. Marking the topic complete ticks the rest.