NAME
beef - Flexible Brainfuck interpreterSYNOPSIS
beef [OPTION]... FILEDESCRIPTION
Beef is a flexible interpreter for the Brainfuck programming language.OPTIONS
-p, --program=PROGRAMExecute PROGRAM. This can only be used
if a FILE containing a Brainfuck program has not been provided on the
command line after all options.
Choose the value to store in the tape when the
end of input is reached. WHAT defaults to zero (store a zero);
other possible values are eof (store -1, the value usually assigned to
the C constant EOF) or same (leave the value untouched).
Enable debugging support. By default,
debugging instructions are not executed.
Write program's output to FILE.
Read program's input from FILE.
BRAINFUCK LANGUAGE
Brainfuck programs work on a memory tape which contains a virtually unlimited number of cells; each cell can store a value, which can be seen either as a character or as an integer number (its ASCII encoding) depending on the context. There is a cursor pointing to one of the cells, which is considered to be the current one; the cursor can be moved around at will.Increase the value in the current cell by
one.
Decrease the value in the current cell by
one.
Move the cursor one cell to the right.
Move the cursor one cell to the left.
Start a loop. The instructions contained in
the loop are executed as long as the value of the current cell is not
zero.
End a loop started by a '['
instruction.
Read a character from the input and store it
in che current cell.
Write the value of the current cell to the
output.
Dump the content of the memory tape for
debugging purposes. This instruction is ignored unless the
enable-debugging option is present.
EXAMPLES
The classic Hello World program could be written in Brainfuck as++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.++++++ +..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
#!/usr/bin/beef ,[.,]
1.2.0 |