Search code examples
brainfuck

In brainfuck, how does the interpreter deal with going below 0 in the tape?


I am not sure that I understand what exactly the interpreter does to handle moving the current index of the tape below zero. Should the interpreter allow the tape to go below 0? Thank you!


Solution

  • That is simply undefined behavior. Some allow it, although most don't, because it's simpler to implement that way.