only int-cast param when needed

This commit is contained in:
Stefan Harmuth 2020-12-08 09:04:38 +01:00
parent 9b0b8eb1f6
commit aa5ae674ec

View File

@ -19,15 +19,13 @@ def runCode(lines, infinite_returns_value=False):
lines_executed.add(line_pointer)
command, param = lines[line_pointer].split()
param = int(param)
if command == 'nop':
pass
line_pointer += 1
elif command == 'acc':
accumulator = accumulator + param
accumulator = accumulator + int(param)
line_pointer += 1
elif command == 'jmp':
line_pointer = line_pointer + param
line_pointer = line_pointer + int(param)
return accumulator