Solution to the robot movement problem.