aboutsummaryrefslogtreecommitdiff

CleanBrainfuck

Brainfuck interpreter in Clean

Brainfuck.dcl and Brainfuck.icl give you everything you need to use the module. In ExecBrainfuck.icl, a basic usage example is given.

Compiling & running the example

You're assumed to have a brainfuck program program.bf in the same directory. For an example, see Wikipedia. This program outputs Hello world!\n:

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.

Compiling:

clm ExecBrainfuck -o ExecBrainfuck

Running:

./ExecBrainfuck -nr -nt < program.bf

The example program expects the brainfuck program to be the first line on stdin. Any further lines are seen as input to the brainfuck program.

License

This program and the example are distributed under the MIT license. For more details, see the LICENSE file.