Robot Program: Five Commands
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. The robot starts at column 1, row 1, facing up. Row 3 has lettered tiles: D at column 2, C at column 3, B at column 4, A at column 5. Its program is: forward, forward, turn right, forward, forward. Forward moves 1 tile; a turn happens on the spot. Which tile does it stop on: A, B, C or D?
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.
C
Up 2, turn right, then 2 forward: it stops on C.
How to solve it
Step 1: track position and facing together after each command. Start at column 1, row 1, facing up.
Step 2: run the program. Forward takes it to row 2, forward again to row 3, still in column 1. The curved arrow turns it to its own right on the spot; since it faces up, its right is the right side of the grid, and it does not move. Forward goes to column 2, forward again to column 3. It stops at column 3, row 3.
Step 3: read the tile. Row 3 holds D in column 2, C in column 3, B in column 4 and A in column 5, so the robot is on C.
The usual wrong answer is D, from making only one move after the turn. B and A come from overshooting, as if the robot kept rolling along row 3.
The answer is C. Quick check: two forward moves up, then two to the right, so the robot ends 2 columns right of where it started.