use getDirection method of the Robot class