Sequence: the robot on the grid
Loading…
What you will learn
By the end, you can follow a robot's program step by step and predict the square where it stops.
Mila and Noah give the robot Bolt the same three blocks: move forward, move forward, turn right. Mila puts the turn first. Noah puts it last. Bolt stops on two different squares, and only one of them has the battery.
Read the explanation
A program is a sequence: a list of instructions the computer runs one after another, from top to bottom. The same instructions in a different order make a different journey. To predict the end, trace the lines in order, one at a time.
- Run the lines from top to bottom, one at a time.
- move forward = one square in the direction Bolt faces.
- turn right or turn left = Bolt spins on the spot; it does not move.
