Skip to content

Commit 456293c

Browse files
committed
More refactoring
1 parent 0c8bde5 commit 456293c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Day-08/python/paul2708/solution.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Program():
77
def __init__(self, instructions: [str]):
88
self.accumulator = 0
99
self.instruction_pointer = 0
10-
self.instructions = instructions
10+
self.instructions = list(instructions)
1111

1212
def run(self):
1313
instruction = instructions[self.instruction_pointer]
@@ -77,8 +77,8 @@ def replace(replacement_list: [str], old: str, new: str, start: int) -> ([str],
7777
return [], -1
7878

7979

80-
replaced_instructions_list = replace_all(read_lines("day08"), "jmp", "nop") \
81-
+ replace_all(read_lines("day08"), "nop", "jmp")
80+
replaced_instructions_list = replace_all(instructions, "jmp", "nop") \
81+
+ replace_all(instructions, "nop", "jmp")
8282

8383
for instructions in replaced_instructions_list:
8484
program = Program(instructions)

0 commit comments

Comments
 (0)