1
Directions for a robot
Computing 2: Unit 8, pp. 106–121
GoalGive a floor robot directions with forward, back, turn left and turn right.
New words
direction · which way to goforward · the way the robot is facingturn · to change the way the robot faces, on the spot
Explanation
A floor robot follows instructions one at a time. Forward moves it one step the way it faces. Back moves it one step the other way. Turn left and turn right make a quarter turn on the spot. Left and right are the robot’s left and right, not yours. So you must look at which way the robot faces.
Worked examples
The robot starts in the middle of the grid, facing up. It goes forward 2, turns right and goes forward 1. The line shows its path.
The robot faces down the page. When it turns left, it faces to our right, because its left is our right. Then it goes forward 2.
Back moves the robot the other way without turning. It goes forward 2 and then back 1, so it ends one step from where it was after the forward moves.
Class activity
Be the robot: mark a grid of squares on the floor with tape or chalk. One child is the robot and stands on a square, facing a wall. A partner says one command at a time: forward, back, turn left or turn right. The robot must do exactly what is said, even if it is silly. The partner stands behind the robot so that left and right match. Draw the path on paper. Then swap jobs.
Practice
1
A robot starts on square A1, facing up. It does forward 3, turn right, forward 2. Which square does it stop on? Rows are numbered from the bottom.
C4. Forward 3 takes it to A4. Then it faces right and goes 2 squares to C4.
2
A robot faces up. It turns right. Which way does it face? It turns right again. Which way now?
After the first turn it faces right. After the second turn it faces down.
3
Write the commands for this path. The robot starts facing right.
Forward 2, turn left, forward 2.
4
Why must we look at the way the robot faces before we say “turn left”?
The robot’s left depends on the way it faces. It may not be the same as our left.