Advertisement
Guest User

cc

a guest
Apr 18th, 2017
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         elif char == '[':
  2.             if array[ptr]:
  3.                 stack.append(i)
  4.             else:
  5.                 while True:
  6.                     char = bf_code[i]
  7.                     if char == '[':
  8.                         depth += 1
  9.                         i += 1
  10.                     elif char == ']':
  11.                         depth -= 1
  12.                         i += 1
  13.                     elif char == '<' or char == '>' or char == '+' or char == '-' or char == '.' or char == ',':
  14.                         i +=1
  15.                     if depth == 0:
  16.                         break
  17.         elif char == ']':
  18.             i = stack.pop() -1
  19.  
  20.         i += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement