aboutsummaryrefslogtreecommitdiff
path: root/README.md
blob: 0000ddd8327bc339e26e8e1c68badc2ab5ed9871 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# CleanBrainfuck
[Brainfuck](http://en.wikipedia.org/wiki/Brainfuck) interpreter in [Clean](http://wiki.clean.cs.ru.nl/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](http://en.wikipedia.org/wiki/Brainfuck). This program outputs `Hello world!\n`:

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

Compiling:

    clm ExecBrainfuck -o ExecBrainfuck

Running: 

    ./ExecBrainfuck < 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.