Remove debug prints from day 5

This commit is contained in:
Nick Krichevsky 2019-12-05 01:44:22 -05:00
parent 3178d9cfc2
commit ba452634ba

View file

@ -75,17 +75,13 @@ class Operation:
# Add 1 to move past the opcode itself
pointer = instruction_pointer + i + 1
arg = memory[pointer]
print(f"raw_arg={arg}")
if mode == Operation.MODE_PARAMETER:
print(f"Resolving {arg} to {memory[arg]}")
arg = memory[arg]
elif mode != Operation.MODE_IMMEDIATE:
raise ValueError(f"Invalid parameter mode {mode}")
args.append(arg)
print("MODES:", self.modes)
print("ARGS:", args)
func = OPERATION_FUNCS[self.opcode]
if program_input is not None:
jump_addr = func(memory, program_input, *args)
@ -100,17 +96,14 @@ class Operation:
@staticmethod
def add(memory: List[int], a: int, b: int, loc: int) -> None:
memory[loc] = a + b
print(f"{a} + {b} => {memory[loc]} @ {loc}")
@staticmethod
def multiply(memory: List[int], a: int, b: int, loc: int) -> None:
memory[loc] = a * b
print(f"{a} * {b} => {memory[loc]} @ {loc}")
@staticmethod
def input(memory: List[int], program_input: int, loc: int) -> None:
memory[loc] = program_input
print(f"{program_input} => {memory[loc]} @ {loc}")
@staticmethod
def output(memory: List[int], value: int) -> None: