From ab2a36260e69dac5d97dfdf8e6470cb11d6b30ec Mon Sep 17 00:00:00 2001 From: Ryan Hitchman Date: Tue, 6 May 2014 19:19:42 -0700 Subject: [PATCH] bf: fix order of operations --- plugins/bf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/bf.py b/plugins/bf.py index 8e86832..0c785b5 100644 --- a/plugins/bf.py +++ b/plugins/bf.py @@ -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: