From: Neil Smith Date: Tue, 18 Jul 2017 08:45:43 +0000 (+0100) Subject: Added comments to the BF code, show execution count X-Git-Url: https://git.njae.me.uk/?p=ou-summer-of-code-2017.git;a=commitdiff_plain;h=db3fb1fbf8fe298d454ae983107d0d15edc30779 Added comments to the BF code, show execution count --- diff --git a/02-lifts/bf2.py b/02-lifts/bf2.py index 4170111..3e3331e 100644 --- a/02-lifts/bf2.py +++ b/02-lifts/bf2.py @@ -276,6 +276,7 @@ def evaluate(code, inp=None, debug=False, execution_limit=0): break except EOFError: pass + print(execution_count) return cells, codeptr, cellptr, outputs diff --git a/02-lifts/part2.bf b/02-lifts/part2.bf index 0b430f4..1eefb7a 100644 --- a/02-lifts/part2.bf +++ b/02-lifts/part2.bf @@ -1,3 +1,18 @@ +set cell 1 to 61 # exit +set cell 2 to 94 minus 61=33 # up +set cell 3 to 118 minus 94=24 # down + +cell 5 for currently at an exit: 1 if at an exit 0 otherwise + +set cell 6 to 0 (current level) +set cell 7 to for height above ground min zero +set cell 8 to 0 (highest exit) +cell 9 for input +cell 10 for whether input has been dealt with: 0 for yes 1 for no +cell 11 for whether dealt with the height above zero cell +reserve cell 12 and higher for scratch + + >+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++>++++++++++++++++++++++++