title: Loop stops even though only 1 of 2 variables is true
body: <p>So I'm attempting to make a Brainfuck interpreter, however in the while loop that I am using to execute the Brainfuck loop, it is breaking out even though only one condition is true.</p>
  
  <p>Example:</p>
  
  <pre><code>+++[&gt;+&lt;-]
  </code></pre>
  
  <p>Should result in:</p>
  
  <pre><code>[0, 3]
  </code></pre>
  
  <p>However, when the loop begins at <code>[</code>, it will create a new cell so the structure goes from <code>[3]</code> to <code>[3, 0]</code>. Thus, the current working cell is <code>0</code> and the loop is breaking out. However, I have it to only break if it is <code>0</code> and the current character is <code>]</code>.</p>
  
  <pre><code>cells = [0] # Array of data cells in use
  brainfuck = str(input("Input Brainfuck Code: ")) # Brainfuck code
  workingCell = 0 # Data pointer position
  count = 0 # Current position in code
  def commands(command):
      global cells
      global workingCell
      if command == "&gt;":
          workingCell += 1
          if workingCell &gt; len(cells) - 1:
              cells.append(0)
      elif command == "&lt;":
          workingCell -= 1
      elif command == "+":
          cells[workingCell] += 1
      elif command == "-":
          cells[workingCell] -= 1
      elif command == ".":
          print(chr(cells[workingCell]))
      elif command == ",":
          cells[workingCell] = int(input("Input: "))
  def looper(count):
      global cells
      global workingCell
      print("START LOOP", count)
      count += 1
      looper = loopStart = count
      while brainfuck[looper] != "]" and cells[workingCell] != 0: # This line is causing trouble
          if brainfuck[looper] == "]":
              looper = loopStart
          commands(brainfuck[looper])
          count += 1
          looper += 1
      return count
  while count &lt; len(brainfuck):
      if brainfuck[count] == "[":
          count = looper(count)
          print("END LOOP", count)
      else:
          commands(brainfuck[count])
      count += 1
  </code></pre>
  
  <p>Thank you in advance.</p>