1
Predict, then check
Computing 1: Topic 1.3, pp. 33–48
GoalPredict what a program will do, then run or trace it to check.
New words
predict · think about what will happen before it happenscheck · run or trace the code to see if you were right
Explanation
To predict is to think about what will happen next. First look at the code. Trace it on the grid with your finger. Say where the robot will end. Then run the program to check. It is fine if you were wrong. Find out why.
Worked examples
Predict: the robot starts at the bottom right facing up. Code: F F F L F. It goes up three, turns left, goes forward one. It ends on the star.
Aisha predicted that the robot would stop next to the tree. When she ran it, it stopped on the pig. She traced it again. She had counted a turn as a step. Now she knows to look for that.
We predict in everyday life too. A ball at the top of a slide will roll down. We predict, then we look.
Class activity
Prediction game: lay out a 4 by 4 grid on the floor. Write a short code on cards, such as F F R F. Before you walk it, each person points to the square where they think the robot ends. Walk the code. Who was right? Talk about why.
Practice
1
What does ‘predict’ mean?
To think about what will happen before it happens.
2
The robot starts at the bottom left facing up. Code: F R F. Predict where it ends.
B2. (Up one, turn right, forward one.)
3
Your prediction was wrong. What should you do?
Trace the code again and find where you made a mistake.
4
How do we check a prediction?
Run the program, or trace it carefully on the grid.