revised code, input classes Grid, Rover and instance methods size, initial_state, to_left, to_right, go_ahead