Robot Program: Zigzag
Read the puzzle
A robot sits on a 5 by 5 grid. Number columns 1 to 5 from the left and rows 1 to 5 from the bottom. It starts at column 3, row 1, facing up. Row 4 has lettered tiles: A at column 2, C at column 3, D at column 4, B at column 5. Program: forward, forward, turn left, forward, turn right, forward, turn right, forward, forward. Forward moves 1 tile; turns are on the spot, to its own left or right. Which tile does it stop on?
Straight arrow: 1 tile forward. Curved arrow: turn on the spot, to its own left or right. Which tile does it stop on?
Turns use the robot's own left and right, and a turn does not move it.
D
Up 2, left 1, up 1, then right 2: tile D.
How to solve it
Step 1: keep track of both where the robot is and which way it faces. It starts at column 3, row 1, facing up.
Step 2: run the commands. Forward, forward: column 3, row 3. Turn left: now facing left, no move. Forward: column 2, row 3. Turn right: from facing left, its right is up. Forward: column 2, row 4. Turn right: from facing up, its right is the right side of the grid. Forward, forward: column 3, then column 4, still in row 4.
Step 3: read the tile. Row 4 holds A in column 2, C in column 3, D in column 4 and B in column 5. The robot stops on D.
The usual wrong answer is C, from treating the final two forward moves as one and stopping a tile short. Another slip is letting a turn move the robot a tile, which throws every later step off.
The answer is D. Quick check: net movement is up 3 and right 1 (left 1, then right 2), from column 3 to column 4.