BRAINFUCK(1) BSD Reference Manual BRAINFUCK(1)
brainfuck - Brainfuck interpreter written in Perl
brainfuck [file ...]
The brainfuck utility interprets its standard input as a Brainfuck script. Processing will start after EOF. If you started brainfuck in- teractively, hit ^D (Ctrl-D) on a new line to start. If optional arguments (file ...) are passed, these are run as if con- catenated instead, and standard input processing starts immediately when utilised by the script.
Brainfuck is a simple enough language to include the entire official language describtion in this manual page. The following table is from the original Brainfuck distribution by its inventor Urban Mueller <umueller@amiga.physik.unizh.ch>: The language Brainfuck knows the following commands: Cmd Effect Equivalent in C --- ------ --------------- + Increases element under pointer array[p]++; - Decrases element under pointer array[p]--; > Increases pointer p++; < Decreases pointer p--; [ Starts loop, counter under pointer while(array[p]) { ] Indicates end of loop } . Outputs ASCII code under pointer putchar(array[p]); , Reads char and stores ASCII under ptr array[p]=getchar(); All other characters are ignored. The array elements and p are being initialized to zero at the beginning. Now while this seems to be a pretty useless language, it can be proven that it can compute every solvable mathematical problem (if we ignore the array size limit and the executable size limit). This implementation reads and writes to stdio in bytes. Its cells are of the size of a standard Perl integral type, signed and with wrap-around behaviour. It uses LF as end of line and -1 as end of input indicator.
perl(1)
brainfuck first appeared in MirBSD #1.
Urban Mueller designed the language. Marko Nippula wrote this interpreter. The Chaos Computer Club Cologne gave some hints for the man page. Thorsten Glaser wrote this man page, put things together for MirBSD, and later corrected the interpreter. MirBSD #10-current September 4, 2020 1