[Question]
  [
[Brainfuck](https://esolangs.org/wiki/brainfuck) is an esoteric programming language that is Turing Complete, meaning you can't tell whether a given program will halt without running it. It's cell-based and has an infinite tape of cells, values containing an unsigned integer from 0 to 255, but if you give it arbitrary-size cells, just three is enough to make it Turing Complete.
But one cell isn't in either case.
The bit of brainfuck that we'll be using contains these four operations:
* `+`: Increment the current cell
* `-`: Decrement the current cell
* `[`: Loop while the current cell is nonzero
* `]`: End a loop
You should use a single unsigned integer from 0 to 255 as the cell, wrapping round when you decrement zero or increment 255.
You may return any two distinct, consistent values to say whether it halts or not. The program will be a valid brainfuck program (balanced brackets) and only contain these four characters. You may *not* output by halting/not halting.
## Testcases
If you want to look at these in more depth, [here](https://fatiherikli.github.io/brainfuck-visualizer/)'s a good visualizer.
### Falsy (doesn't halt)
```
+[]
+[++]
+[++[+]--]
+[----]
+[-]-[+[-]-]
+[[-]-[+[-]-+[++]-[+]]-[++][-]]
++[-]+[--]-
```
### Truthy (halts)
```
[+]
+
+[+]
++[+++]
+++--[++-][+][+]
+[+]-[+++]-
```
Standard [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'") rules apply.
  
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), 36 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
0ì„+-„><‡'[„₄ƒ:']"D₁Ö#N₄Qi0q}}":1«.V
```
Outputs `1` if it halts; `0` if it doesn't halt.
[Try it online](https://tio.run/##yy9OTMpM/f/f4PCaRw3ztHWBhJ3No4aF6tFA1qOmlmOTrNRjlVweNTUenqbsBxQIzDQorK1VsjI8tFov7P9/7eho3VjdaG0QqR2trQ1ix4II7VigUCwA) or [verify all test cases](https://tio.run/##XU47CsJAEO33FEMULMbx00owjVoqNjbLFolZSECMP7ASVMQDWFgK1noKAx5kLxJ3NoJg8@bNm3lvJgrXSTENN9CFaRbrRrYOo1SD70N/NBCBB@Z8AS8oWvnT7G9IFrq@2d9r0jJzPL0vnZryeuZ4yK@VoRXGaau@3O28Tvv1aEyKuuAcsU3SmYaVDmNI5yLOBEAzW2ya5blv@fvAh6rbnesCpRIoEUuUqIiYEn2rIumQm1/nHJYrBlRWsnOesFORkJzHiU5GF49IvEzKqrK859wWxQc).
**Explanation:**
```
0ì                 # Prepend a "0" in front of the (implicit) input-string
„+-„><‡            # Replace all "+" with ">" and all "-" with "<"
'[„₄ƒ:            '# Replace all "[" with "₄ƒ"
']"D₁Ö#N₄Qi0q}}": '# Replace all "]" with "D₁Ö#N₄Qi0q}}"
1«                 # Append a trailing "1" at the end
.V                 # Execute it as 05AB1E code
                   # (after which the result is output implicitly)
```
[Verify all test cases without `.V` to see what 05AB1E programs the inputs are transformed into.](https://tio.run/##yy9OTMpM/V9TVmmvpPCobZKCkn3lf4PDax41zNPWBRJ2No8aFqpHA1mPmlqOTbJSj1VyedTUeHiash9QIDDToLC2VsnK8NDq/zr/taNjubSjtbUhZLR2rK4uiKmrC6VjdaPBJIiD4IF1ANmxIEI7FigElAfJgHTG6nJFg8wDmQgW1gYbr62tC1KsGwsUjYbYB9YNJAE)
```
0ì                 # We start the cell at 0
„+-„><‡            # `>` increases the top of the stack by 1
                   # `<` decreases the top of the stack by 1
'[„₄ƒ:            '# `₄ƒ` loop `N` in the range [0,1000]
']"D₁Ö#N₄Qi0q}}": '# 
   D               # Duplicate the top
    ₁Ö             # Pop and check if it's divisible by 256
      #            # If this is truthy: stop the loop
       N           # Else: push the loop index `N`
        ₄Qi        # If it's equal to 1000:
           0       #  Push a 0
            q      #  And stop the entire program
                   #  (after which this 0 is output implicitly as result)
             }     # Close the if-statement
              }    # Close the loop
1«                 # Push a 1
                   # (which is output implicitly as result if we didn't halt)
```
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), 116 bytes
```
s=>eval(`try{${s.replace(/./g,(c,i)=>(c=='['?'for(;v;){':c>{}?'}':`v=v${c}1&255`)+`;s[t++>>9].x;`)}}catch{1}`,v=t=0)
```
[Try it online!](https://tio.run/##dVBNawMhEL33V/QQojLrpink0Ijmh4igWDdJWWJYRVLE377d3RZ62HgZhnnzeB9fJplgh@s90pv/dGP3ysfAhUumxzoO33mTQzu4e2@sw7t2d26wba6EC2w5RxKdUOcHzBIjGR2tyOWECjrqxNMm27Lfvh8OmoBmQUYAIT5U@2CalGJNtJe8L7pJPPI3Mlp/C753be/PuMMIpEKEsJfVGaAKSFCUVlBK65CicpkV/P9hUZ92NQ9Q0@k5ZX6eJRVdwWg2gtYcWYlVyVrThVo9AHT2TNXEldUKl1zwxPZfw7/E8Qc "JavaScript (Node.js) – Try It Online")
---
# [JavaScript (Node.js)](https://nodejs.org), 135 bytes
```
s=>(e=(p,v,b=0)=>(s[p]=='['?b|!v?++b:b:s[p]>'['?b|v?--b:b:b)?e(b>0?p+1:p-1,v,b):s[p]?e[m=[p,v]]||e(p+(e[m]=1),v+(s[p]+1|0)&255):0)(0,0)
```
[Try it online!](https://tio.run/##dU@9bsMgEN7zFM0SOJ2vwpWyuMI8CLohOLhK5MSojpj87g44lTo4LCf4/u676ymepu73Eh50H89@6T/0MulWei1DFSunFaTfZANrLawwbt5Hg@ga12SwfWHREGXIgfHStcoErJtAdU6AVWi8vWmbIpnn2cuAMgGsa6girvFYzwoOX8cjNAqkqhQs3XifxsF/DuOP7KVAywLge7eBEYuERSYqsERlismus8D/C9bt6c15ICdoaxF5k9jm2ELvwjHvxblAiULKpYiT98@@PAE "JavaScript (Node.js) – Try It Online")
[Answer]
# [Wolfram Language (Mathematica)](https://www.wolfram.com/wolframscript/), 117 bytes
```
ToExpression[a=b=0;StringReplace[#,{"["->"Do[If[c∣a,Break[]];","]"->"i<c||(b=1),{i,c=256}];",c_:>"a"<>c<>"=1;"}]]b&
```
[Try it online!](https://tio.run/##RU3BSsQwEL33K8IUFiUJuoIebBNE9OBNXG/DIGlINbi7Ld0ehN29@x/@mT9SM6mwlzcz7817b@PGj7BxY/RuaoWZXrvHr34Iu13stuhMYy6r1TjE7ftL6NfOByzVHhC0hYcOn1r0v98/Tt0PwX0iUQUKiMVY@8PhrDHLc7WPypur65sjq/7t1oKD2vragllWcCRqFtNzahixFNqKFksisRAXd2IuXvXrOGIBEqmQKOWMKElrXrX@n6QxIx@nKzvSTgySEpV0VthJukDO48RMyxwvpeZnTYnFuS@7EwJNfw "Wolfram Language (Mathematica) – Try It Online")
[Answer]
# [Python 3](https://docs.python.org/3/), 245 bytes
```
p=input()
m={}
s=[]
for i,c in enumerate(p):
	if"["==c:s+=[i]
	if"]"==c:m[s[-1]]=i;m[i]=s.pop()
a=n=0
while a<len(p):
	if(a,n)in s:print();break
	s+=[(a,n)];q=p[a]
	if"["==q and n<1or"]"==q and n:a=m[a]
	if"+"==q:n+=1
	if"-"==q:n-=1
	a+=1;n%=256
```
[Try it online!](https://tio.run/##PY7BagMxDETP8VeYQGAXx6Hb0h680ZcIHdzUIaax1rE3lFLy7RvbbXoRmjdiRvF7Pk38siwRPMfr3PUiwM9NZEASxylJvz1Iz9LxNbhkZ9fF3oiVP65xDXAwWQF6aoAaCJhRD0Tgx1AcyLs4xZJqgeFJfJ382Um7Pzt@BHV2y31pyCYmz@WB8T05@ylWNbqZNF4goqX/2ou0/CF5P0yptf5pYyE8zlTFhhUMTepfqau0BY68gefXt2VRiJo0qjoVKlV3qkNRQXQH "Python 3 – Try It Online")
so idrk how the fancy string substitution solutions are working so here's my terrible attempt to just run the code instead
[Answer]
# [Charcoal](https://github.com/somebody1234/Charcoal), ~~90~~ 88 bytes
```
≔⁰η≔⁰ζ≔⟦⟧εＷ∧‹ηＬθ¬№υ⟦ηζ⟧«⊞υ⟦ηζ⟧≡§θη[¿ζ⊞εηＷ›№…θ⊕η[⁺№…θ⊕η]Ｌε≦⊕η]≔⊖⊟εη≔﹪⁺Ｉ⁺§θη1ζ²⁵⁶ζ≦⊕η»⁼ηＬθ
```
[Try it online!](https://tio.run/##jZFBa8MgFMfP5lNITkoT2AbboTmVbIxCO3IPOYh5rQGnTdR1y@hnz0wiS7fDmPDEp3//7/eUC9ZxzeQwbIxpjorcJFjQLFqyfsnKKsHg07NoJGCyUTXZgTFEJHgH6mgFaSlN8Iu2JNdOWeISXPrDvqJ@4M8IFc6Iq90sQubcWC68md2qGt5JO9aftJwZwHEZryOEmgMmPcXTdZgJEQLpBYHluQNmoQt18w8uIRf6NNptFe/gFZSFmoiRz3v6uZDO/E9ejfLQIEyd7NkpPMmVOmDN2FW8xkHyCIth4WvAaDpJazgwJ@23cq9rJzWZyZix8@rHy3ic23g06H3c3T/Q@YPQJUJ/QF2iomt8o0@tY/LXf9FsGFarMq18pFU6pG/yCw "Charcoal – Try It Online") Link is to verbose version of code. Outputs a Charcoal boolean, i.e. `-` if the program halts, nothing if not. Explanation:
```
≔⁰η
```
Start at the beginning of the code.
```
≔⁰ζ
```
Start with zero in the cell.
```
≔⟦⟧ε
```
Start with no unmatched `[`s.
```
Ｗ∧‹ηＬθ¬№υ⟦ηζ⟧«
```
Repeat until either the end of the program is reached or the current state has been seen previously (i.e. an infinite loop has been detected).
```
⊞υ⟦ηζ⟧
```
Record the current state.
```
≡§θη
```
Switch on the next program character.
```
[¿ζ
```
For `[`, if the cell is non-zero, then...
```
⊞εη
```
... save the current position, so it can be quickly restored when the matching `]` is reached, otherwise...
```
Ｗ›№…θ⊕η[⁺№…θ⊕η]Ｌε≦⊕η
```
... advance the current position to the matching `]`.
```
]≔⊖⊟εη
```
For `]`, jump back to the matching `[`, which will then test the cell value.
```
≔﹪⁺Ｉ⁺§θη1ζ²⁵⁶ζ
```
Otherwise, adjust the cell value modulo 256 as necessary.
```
≦⊕η
```
Advance to the next character of the program. (In the case of `[` jumping forward to its matching `]`, this skips past the `]`. In the case of `]` jumping back to its matching `[`, this increment has been adjusted for, so that the `[` becomes the next code to execute.)
```
»⁼ηＬθ
```
Output whether the end of the program was reached.
]