An Eight-Instruction Turing-Complete Programming Language
Brainfuck is the ungodly creation of Urban Müller, whose goal wasapparently to create a Turing-complete language for which he couldwrite the smallest compiler ever, for the Amiga OS 2.0. His compilerwas 240 bytes in size. (Though he improved upon this later -- heinformed me at one point that he had managed to bring it under 200bytes.)
Source Viewer: Memory Viewer: Input Viewer: Output Viewer: Note: The hash ('#') character marks a breakpoint. Example programs taken from the Brainfuck Archivethe Brainfuck. Code, create, and learn together Code, collaborate, compile, run, share, and deploy BrainF and more online from your browser.
I originally started playing around with Brainfuck because of my owninterest in writing very small programs for x86 Linux. I also used itas a vehicle for writing a program that created ELF files. Eventually,however, I too succumbed to the Imp of the Perverse and wrote someactual Brainfuck programs of my own.
The Language
A Brainfuck program has an implicit byte pointer, called 'thepointer', which is free to move around within an array of 30000 bytes,initially all set to zero. The pointer itself is initialized to pointto the beginning of this array. Mediashout crack download.
The Brainfuck programming language consists of eight commands, each ofwhich is represented as a single character.
Bf Ideal
> | Increment the pointer. |
< | Decrement the pointer. |
+ | Increment the byte at the pointer. |
- | Decrement the byte at the pointer. |
. | Output the byte at the pointer. |
, | Input a byte and store it in the byte at the pointer. |
[ | Jump forward past the matching ] if the byte at the pointer is zero. |
] | Jump backward to the matching [ unless the byte at the pointer is zero. |
The semantics of the Brainfuck commands can also be succinctlyexpressed in terms of C, as follows (assuming that p has beenpreviously defined as a char*):
> | becomes | ++p; |
< | becomes | --p; |
+ | becomes | ++*p; |
- | becomes | --*p; |
. | becomes | putchar(*p); |
, | becomes | *p = getchar(); |
[ | becomes | while (*p) { |
] | becomes | } |
Resources
- ABrainfuck compiler for Linux. This is the final result of myattempt at the tiny-compiler challenge. The executable is 166 bytes insize.
- My own Brainfuck programs include an 822-bytequine, andfactor, a program that factors arbitrarilylarge integers in an arbitrarly large amount of time — and whatmay have been, at the time that I wrote it, the largest Brainfuckprogram in existence.
- Portable Brainfuck. My informal standardsguide for programmers and implementers alike.
- MyELF Kickers package contains several programs that deal with theELF file format. Included is ebfc, a real Brainfuck compiler (compilesexecutables and object files).
- pibfi.Cat's Eye Technologies provides pibfi, the Platonic Ideal BrainfuckInterpreter. This interpreter can emulate most if not all otherinterpreters.
- The Brainfuckarchive. Panu Kalliokoski provides a collection of Brainfuckcompilers, interpreters, preprocessors, and of course extant Brainfuckprograms.
- Wikipedia's entry onBrainfuck. The entry contains a in-depth description of thelanguage and several basic algorithms, as well as a list of derivativelanguages.
An Eight-Instruction Turing-Complete Programming Language
Brainfuck is the ungodly creation of Urban Müller, whose goal wasapparently to create a Turing-complete language for which he couldwrite the smallest compiler ever, for the Amiga OS 2.0. His compilerwas 240 bytes in size. (Though he improved upon this later -- heinformed me at one point that he had managed to bring it under 200bytes.)
I originally started playing around with Brainfuck because of my owninterest in writing very small programs for x86 Linux. I also used itas a vehicle for writing a program that created ELF files. Eventually,however, I too succumbed to the Imp of the Perverse and wrote someactual Brainfuck programs of my own.
The Language
A Brainfuck program has an implicit byte pointer, called 'thepointer', which is free to move around within an array of 30000 bytes,initially all set to zero. The pointer itself is initialized to pointto the beginning of this array.
Core keygen. The Brainfuck programming language consists of eight commands, each ofwhich is represented as a single character.
> | Increment the pointer. |
< | Decrement the pointer. |
+ | Increment the byte at the pointer. |
- | Decrement the byte at the pointer. |
. | Output the byte at the pointer. |
, | Input a byte and store it in the byte at the pointer. |
[ | Jump forward past the matching ] if the byte at the pointer is zero. |
] | Jump backward to the matching [ unless the byte at the pointer is zero. |
The semantics of the Brainfuck commands can also be succinctlyexpressed in terms of C, as follows (assuming that p has beenpreviously defined as a char*):
Cheap Homemade Teen Bf Ideas
> | becomes | ++p; |
< | becomes | --p; |
+ | becomes | ++*p; |
- | becomes | --*p; |
. | becomes | putchar(*p); |
, | becomes | *p = getchar(); |
[ | becomes | while (*p) { |
] | becomes | } |
Resources
354 Days Jar For Bf Idea
- ABrainfuck compiler for Linux. This is the final result of myattempt at the tiny-compiler challenge. The executable is 166 bytes insize.
- My own Brainfuck programs include an 822-bytequine, andfactor, a program that factors arbitrarilylarge integers in an arbitrarly large amount of time — and whatmay have been, at the time that I wrote it, the largest Brainfuckprogram in existence.
- Portable Brainfuck. My informal standardsguide for programmers and implementers alike.
- MyELF Kickers package contains several programs that deal with theELF file format. Included is ebfc, a real Brainfuck compiler (compilesexecutables and object files).
- pibfi.Cat's Eye Technologies provides pibfi, the Platonic Ideal BrainfuckInterpreter. This interpreter can emulate most if not all otherinterpreters.
- The Brainfuckarchive. Panu Kalliokoski provides a collection of Brainfuckcompilers, interpreters, preprocessors, and of course extant Brainfuckprograms.
- Wikipedia's entry onBrainfuck. The entry contains a in-depth description of thelanguage and several basic algorithms, as well as a list of derivativelanguages.