bf: fix order of operations
This commit is contained in:
parent
0a84f84e57
commit
ab2a36260e
|
@ -45,9 +45,9 @@ def bf(inp):
|
|||
while ip < len(program):
|
||||
c = program[ip]
|
||||
if c == '+':
|
||||
memory[mp] = memory[mp] + 1 % 256
|
||||
memory[mp] = (memory[mp] + 1) % 256
|
||||
elif c == '-':
|
||||
memory[mp] = memory[mp] - 1 % 256
|
||||
memory[mp] = (memory[mp] - 1) % 256
|
||||
elif c == '>':
|
||||
mp += 1
|
||||
if mp > rightmost:
|
||||
|
|
Loading…
Reference in New Issue