def execute_line(
    instr : tuple[str, int], # The instruction to execute
    pos : int,               # The current position in code   
    acc=None                 # The accumulator
) -> int:
    """Executes an instruction and returns the position of the next instruction"""
    
    if (instr[0] == "jmp"):
        return pos + instr[1]

    if (instr[0] == "acc"):
        if acc:
            acc.value += instr[1]
    elif (instr[0] != "nop"):
        raise ValueError(f"Unknown instruction: {instr}")

    return pos + 1