2
Where will it end?
Computing 1: Topic 1.2, pp. 19–32
GoalFollow a program on a grid and say where the robot ends.
New words
trace · follow the code one command at a timeend · the square where the robot stops
Explanation
To find where the robot ends, trace the code. Start where the robot starts. Look at which way it faces. Do each card in order. Forward moves one square the way it faces. A turn only changes the way it faces. Put your finger on the grid.
Worked examples
The robot starts at the bottom left facing up. Code: F F R F F. It goes up two squares, turns right, and goes right two squares. It ends at the cow.
The robot starts at the top left facing down. Code: F F L F F B. Down two, turn left (it now faces right), right two, then back one. It ends on the pig.
Turns do not move the robot. This robot starts facing up. Code: R R F. Two turns right make it face down. Then forward moves it one square down.
Class activity
Floor grid: make a grid of paper squares on the floor, 4 by 4. One child is the robot. A partner reads the code, one card at a time: ‘Forward, forward, turn right, forward.’ Where do you end? Say the square, such as B3 (column B, row 3 from the bottom).
Practice
1
The robot starts at A1 facing up. Code: F F R F. Which square does it end on?
B3. (Up two squares to A3, turn right, forward one to B3.)
2
The robot starts at A1 facing up. Code: F R F. Which number does it reach?
2, the flower. (Forward one square, turn right, forward one square.)
3
The robot starts at D1 facing up. Code: F F L F. Which square does it end on?
C3. (Up two squares to D3, turn left, forward one to C3.)
4
A turn moves the robot one square. True or false?
False. A turn only changes the way the robot faces.