A brainfuck interpreter written in JavaScript
Demo available at http://smjth.github.io/brainfuck-js/
var result = bf(program, input, debug, bits);
The bf
function will return a string containing the output of the program. In this example the output is being stored in result
.
program
is a string providing the brainfuck program that will be interpreted.
input
is a string of input that may be processed by the program. (default: '')
debug
is a boolean flag that allows printing of the operations to the console when set to true. (default: false)
bits
is an integer that controls the cell size in bits that the array will handle. (default: 8)
At this time, there are no known bugs in this implementation.