Added comments to the BF code, show execution count
authorNeil Smith <neil.git@njae.me.uk>
Tue, 18 Jul 2017 08:45:43 +0000 (09:45 +0100)
committerNeil Smith <neil.git@njae.me.uk>
Tue, 18 Jul 2017 08:45:43 +0000 (09:45 +0100)
02-lifts/bf2.py
02-lifts/part2.bf

index 417011154843445248a9d830a50fd35575c890ae..3e3331eb5660fb72e3f59c3fd49de193bfe1e188 100644 (file)
@@ -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
 
 
index 0b430f4476d1f0877f560184e4cc4aabc347acff..1eefb7a6072bbfd1dffd9136d7e312eb3fb1f45e 100644 (file)
@@ -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
+
+
 >+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++>+++++++++++++++++++++++++++++++++>++++++++++++++++++++++++