correct bug in brainfuck.py (in function 'interpret') and add full debug support

This commit is contained in:
miggazElquez 2020-01-06 23:53:18 +01:00
parent c97caeee7e
commit 61b4c2cc9c
1 changed files with 11 additions and 0 deletions

View File

@ -61,7 +61,18 @@ def interpret(prog):
if ar[ptr]:
index = blocks.pop()
continue
else:
blocks.pop()
elif instr == '#':
try:
if prog[index+1] == '(':
index = index+2
while prog[index] != ')':
print(prog[index],end='',flush=True)
index += 1
print(' ',end='')
except IndexError:
pass
print(ar, ptr, ar[ptr])
index += 1