Be the Robot

Be the Robot: Unplugged lesson banner with Beep and Pixel

Track: Unplugged  ·  Lesson 1 of 10  ·  Ages: 6+  ·  Time: 30 minutes

Imagine a robot that does exactly what you say, and nothing else. Not what you meant. What you said. Tell it “draw a face” and it might just stare at you, because it does not know where to start!

That is how every computer works, so today you are going to be a computer boss. And a friend (or a grown-up) is going to be the robot.

Beep the robot

Beep says I am a very literal robot. If you say “put on your shoes” and my shoes are in a box, I will try to put on the box! Beep boop! Clear instructions are my favourite.

What you need

  • A friend or grown-up to be the robot.
  • Plain paper and a pencil for the robot to draw on.
  • A second piece of paper and a pen for writing your instructions.
  • A table to work on.

Grown-ups You are the robot, and the trick is to be gently, honestly literal. Do only what the words say. If a step is vague, do the silliest sensible thing (a tiny dot for “draw a circle”) and let your child discover why. Never be unkind about mistakes: the goal is a giggle and a better set of instructions, not a “gotcha”.

Some new words

An instruction is one small step that tells someone what to do. A list of instructions in the right order, that solves a problem, is called an algorithm. (Say it like AL-go-rith-um.) Recipes, board game rules and “how to tie your shoes” are all algorithms.

Computers need algorithms that are precise. That means exact, with no guessing needed.

The robot rules

The robot may only do these things:

  1. Pick up the pencil.
  2. Put the pencil point on the paper in a place you name.
  3. Move the pencil in a direction (up, down, left, right) for a distance you name, like “as long as your finger”.
  4. Draw a circle or a dot of a size you name.
  5. Lift the pencil off the paper.

The robot never guesses. If your instruction is unclear, it does the plainest, simplest thing.

Round 1: a messy first try

Write down instructions for drawing a smiley face. Start with just three lines:

1. Draw a face.
2. Give it eyes.
3. Give it a smile.

Now read them out loud, one at a time. The robot follows each one literally. Did you get a face? Probably not! Where were the eyes? How big was the face? What shape was the smile?

Round 2: be precise

Now rewrite the algorithm so that the robot cannot get it wrong. Here is one good version:

1. Put the paper flat on the table with the long side at the bottom.
2. Pick up the pencil.
3. Put the pencil point in the middle of the paper.
4. Draw a big circle around that spot, as wide as your hand.
5. Lift the pencil.
6. Put the point inside the circle, a bit above the middle and to the left.
7. Draw a small dot.
8. Lift the pencil.
9. Put the point inside the circle, a bit above the middle and to the right.
10. Draw a small dot.
11. Lift the pencil.
12. Put the point in the middle of the circle, a bit below the middle.
13. Draw a curved line like a bowl, about as wide as two fingers.
14. Lift the pencil. You are done!

Test it with your robot. Cross out any step that went wrong and fix it. Testing and fixing is what real programmers do all day!

Pixel says Look how every step is tiny and the order matters. If the robot drew the smile before the circle, the smile could end up floating outside the face! Meow!

Make it better

  • Can you draw the smile before the eyes and still get a happy face?
  • Can you add a nose, or hair, or a hat?
  • Swap jobs. Now you are the robot and your friend writes the algorithm. It is much trickier to be a good robot than you think!

Challenges

Try it Write an algorithm that makes a robot draw a house with a door, a window and a sun. Test it on your friend, then fix the steps that went wrong.

Show a hint

Start with the biggest shape (the square for the wall), then add the roof, then the smaller things. Say exactly where each thing goes: “in the middle of the bottom edge” is better than “at the bottom”.

Show a sample answer
1. Put the pencil point near the bottom left of the paper.
2. Draw a line to the right as long as your hand.
3. Draw a line straight up, as long as your hand.
4. Draw a line to the left until you reach the top of the left side.
5. Draw a line straight down to where you started.
6. Lift the pencil. Put it on the top left corner of the square.
7. Draw a line up and to the right to a point above the middle of the roof.
8. Draw a line down and to the right to the top right corner.
9. Lift the pencil. Draw a small square in the top half of the wall for a window.
10. Draw a tall thin rectangle at the bottom for a door.
11. Draw a small circle above the roof on the right for the sun.

Your own answer will be different, and that is fine. There are many good algorithms for the same job!

Try it No paper needed. Give your robot friend instructions to build a tower out of three plastic cups, using only the words “pick up”, “put”, “on top of” and the cup colours.

What you learned

  • An instruction is one small step.
  • An algorithm is a list of instructions in the right order that solves a problem.
  • Computers cannot guess, so algorithms must be precise.
  • Testing your algorithm and fixing the mistakes makes it better.