We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13768a8 commit cbdba8dCopy full SHA for cbdba8d
2019/IntCode.py
@@ -175,8 +175,10 @@ def op_99(self, instr):
175
self.pointer += self.instr_length["99"]
176
self.state = "Stopped"
177
178
- def run(self):
179
- while self.state == "Running":
+ def run(self, nb_instructions=float("inf")):
+ i = 0
180
+ while self.state == "Running" and i < nb_instructions:
181
+ i += 1
182
opcode_full = self.get_opcode()
183
opcode = opcode_full[-2:]
184
self.modes = opcode_full[:-2]
0 commit comments