2
Same code, new start
Computing 1: Topic 1.3, pp. 33–48
GoalSay that the same code can end in a different place when the robot starts in a different place.
New words
start square · the square where the robot beginsfacing · the way the robot is looking
Explanation
The same code can give different results. It depends on the start square. It also depends on the way the robot faces. Always check both before you predict. Put your finger on the start. Turn your hand to face the same way.
Worked examples
Code: F R F. The robot starts at the bottom left, facing up. It goes up one, turns right, forward one.
Same code F R F. This robot starts one column from the right, facing up. It ends at the right edge.
Same code F R F. This robot starts at the top and faces down. A right turn makes it face left. It ends to the left, not the right.
Class activity
Same code, three starts: write F R F on cards. Use three toys as robots on three different start squares. Face each toy a different way. Predict where each one ends. Then walk all three. Are the ends different?
Practice
1
Does the same code always end on the same square?
No. It depends on the start square and the way the robot faces.
2
Code: F F L F. The robot starts at B3 facing right. Which square does it end on?
D4. (Right two to D3, turn left so it faces up, forward one to D4.)
3
Code: F F R F. The robot starts at D4 (top right) facing down. Which square does it end on?
C2. (Down two to D2, turn right so it faces left, forward one to C2.)
4
Before you predict, what two things do you check about the start?
The start square and the way the robot faces.