Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Brainfuck tools and examples
C Shell
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
Makefile
README
arithm.bf
bf2c
brainfuck.c
clear-cell.bf
clear-prev-cells.bf
copy-cell.bf
hello.bf
max2.bf
move-cell.bf

README

./brainfuck: Brainfuck programming language interpreter
See <http://en.wikipedia.org/wiki/Brainfuck> for more details

Usage: ./brainfuck [options] [file]

Size of each data cell is 4 byte(s)
All data cells are zeros initially

Options (defaults are in brackets):
   -s num         stack size (128)
   -d num         data size (1024)
   -t             trace execution for debugging
   -O             optimize code
   -C             translate into C (to stdout)
   -p cow         translate into Cow (to stdout)

Formats for operators '.' and ',' (output and input):
   -c, -i, -u, -o, -x  char, signed int, unsigned int, octal, hexadecimal
                       octal number must be prepended by '0' (zero),
                       and hexadecimal - by '0x'
Default i/o format -u

   -h             this help message

  file            file to execute,
                  if omitted read stdin

Standard operators: <>+-[].,
Extensions:
            ciuox - change i/o format (same as -c & others above)
            ;     - end of code (useful when reading stdin)
            #     - comment to the end of line (useful when reading files)

Examples:
 echo '+++[.-]' | ./brainfuck # count down from 3 to 1
 echo ',+++.;5' | ./brainfuck # shows 8
 echo ',>,<[->+<]>.;4 5' | ./brainfuck # shows 4+5=9
 echo 'c,u.;h' | ./brainfuck # shows 104 (ASCII code for 'h')
 echo ', [-[->+<]>];4' | ./brainfuck -t # move data pointer by 4 
 echo ',>,< [> [->+<] < -[->+<]> ]; 3 7' | ./brainfuck -t # move '7' by 3 

Something went wrong with that request. Please try again.