Lesson 14 · 60 minutes

Design Your Own Behaviour

From an idea to a program the robot can run

Today's goal

Invent a behaviour nobody has demonstrated, write it, test it, and describe how it fails.

Ideas in this lesson

Sense → Think → Do

You design the whole loop this time.

How the session runs

  1. Pitch: each group writes their behaviour in one sentence on paper before touching a robot.
  2. Sketch the sense-think-do loop: what does it check, what does it decide, what does it do?
  3. Build it in blocks. Keep it under fifteen blocks — short programs fail in ways you can see.
  4. Test it. Then try to break it on purpose and write down what broke.
  5. Demo to the group: the sentence, the demo, and the failure. All three.

Sample program

A starting point: a shy robot that steers away from whichever side something is near, and edges forward when both sides are clear. Take it and make it yours.

V 5
P 12
I 3
R 250
Z
I 8
L 250
Z
F 400
Q

Paste it into the Workshop's Robot language box, then press Text → blocks to see it as blocks — or just send it straight to the robot.

Try this

When it goes wrong

What you seeWhat it means
The behaviour works once, then does something oddPrograms run steps in order without re-checking. A loop makes it keep checking.
Nothing happens at allCheck the sensor really triggers, using Read sensors, before blaming the program.
Notes for the grown-up

Insisting on the sentence before the blocks is the whole lesson. Groups that start by dragging blocks build something that half-works and cannot say what it is; groups that write 'it turns away from whichever side is blocked' debug in minutes.

← Two Robots, One RoomShow & Tell →