コード例 #1
0
def south_right_turn(rover: Rover) -> Rover:
    '''
    Command to turn a South facing rover right.

    Parameters
    ----------
    rover : Rover
        Rover receiving the command.

    Returns
    -------
    Rover
        State of the rover after processing the command.
    '''
    rover.direction = 'W'
    return rover
コード例 #2
0
def east_left_turn(rover: Rover) -> Rover:
    '''
    Command to turn an East facing rover left.

    Parameters
    ----------
    rover : Rover
        Rover receiving the command.

    Returns
    -------
    Rover
        State of the rover after processing the command.
    '''
    rover.direction = 'N'
    return rover