"""PA1 Robot Vacuum.

A hall is a list where hall[spot] is how much dirt is on that spot, and 0
means clean. The robot starts on spot 0, at one end of the hall, and a list of
moves tells it how far to drive each time: right for a positive distance, left
for a negative one.

Name: YOUR NAME
Date: THE DATE
"""


def make_hall(length, spots, amounts):
    """Build a hall with some dirty spots.

    Args:
        length (int): The number of spots in the hall, such as 10.
        spots (list): The spots that are dirty.
        amounts (list): How much dirt is on each; amounts[i] goes with spots[i].

    Returns:
        list: A new list of length ints, where item s is the amount of dirt on
        spot s. Ex: make_hall(5, [1, 4], [2, 1]) returns [0, 2, 0, 0, 1].
        The spots and amounts lists are not changed.
    """
    pass


def step(position, distance, length):
    """Drive the robot once.

    The robot drives distance spots: right if distance is positive, left if it
    is negative. A drive that would go past either end of the hall bounces
    back from that wall by the spots left over: in a hall of 10 spots (0 to
    9), a robot on 7 that drives 4 counts 8, 9, then back to 8 and 7, and a
    robot on 1 that drives -3 counts 0, then back to 1 and 2.

    Args:
        position (int): The spot the robot is on.
        distance (int): How far to drive; never more than length - 1 either way.
        length (int): The number of spots in the hall.

    Returns:
        int: The spot the robot stops on.
    """
    pass


def clean(hall, moves):
    """Run the robot through a list of moves.

    The robot starts on spot 0 and makes every move in order. Each time it
    stops on a spot with dirt, it vacuums up one unit of it.

    Args:
        hall (list): The hall, as made by make_hall.
        moves (list): The distances to drive, one per move.

    Returns:
        tuple: A new list of how much dirt is left on each spot, and the move
        number (counting from 1) on which the last of the dirt was vacuumed, or
        -1 if dirt is left after the last move; a hall with no dirt at all
        returns 0. Ex: on make_hall(5, [1, 4], [2, 1]), the moves [1, 3, -3]
        return ([0, 0, 0, 0, 0], 3), and the moves [4, -2] return
        ([0, 2, 0, 0, 0], -1). The hall and moves lists are not changed.
    """
    pass


if __name__ == "__main__":
    # Do not edit the main block. It prints a cleaning run once clean() works.
    hall = make_hall(12, [3, 6, 10, 11], [1, 2, 1, 1])
    moves = [3, 3, 7, 1, 1, -5, -8, 4]
    left, done = clean(hall, moves)
    print(f"Before: {hall}")
    print(f"After:  {left}")
    if done == -1:
        print(f"Dirt left after {len(moves)} moves")
    else:
        print(f"Clean after move {done} of {len(moves)}")
