> For the complete documentation index, see [llms.txt](https://cajac.gitbook.io/ctf-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cajac.gitbook.io/ctf-notes/prog/other-languages/brainfuck.md).

# Brainfuck

**Brainfuck** is an [esoteric programming language](https://en.wikipedia.org/wiki/Esoteric_programming_language) created in 1993 by Swiss student Urban Müller. Designed to be extremely minimalistic, the language consists of only eight simple commands, a [data pointer](https://en.wikipedia.org/wiki/Data_pointer) and an [instruction pointer](https://en.wikipedia.org/wiki/Instruction_pointer).

Brainfuck is an example of a so-called [Turing tarpit](https://en.wikipedia.org/wiki/Turing_tarpit): it can be used to write any program, but it is not practical to do so, because it provides so little abstraction that the programs get very long or complicated. While Brainfuck is fully [Turing-complete](https://en.wikipedia.org/wiki/Turing_completeness), it is not intended for practical use, but to challenge and amuse [programmers](https://en.wikipedia.org/wiki/Programmers). Brainfuck requires one to break commands into microscopic steps.

The language takes its name from the slang term [*brainfuck*](https://en.wiktionary.org/wiki/brainfuck), which refers to things so complicated or unusual that they exceed the limits of one's understanding, as it was not meant or made for designing actual software but to challenge the boundaries of [computer programming](https://en.wikipedia.org/wiki/Computer_programming).

Because the language's name contains [profanity](https://en.wikipedia.org/wiki/Profanity), many substitutes are used, such as brainfsck, branflakes, brainoof, brainfrick, BrainF, and BF.

## Hello, World!

Sample code for Hello world-program

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

## Online Services

You can use one of these online services to decode/execute Brainfuck code:

bf.doleczek.pl: <https://www.bf.doleczek.pl/>

copy.sh: <https://copy.sh/brainfuck/>

dcode.fr: <https://www.dcode.fr/brainfuck-language>

md5decrypt.net: <https://md5decrypt.net/en/Brainfuck-translator/>

tio.run: <https://tio.run/#brainfuck>

## Resources

Brainfuck - Esolang: <https://esolangs.org/wiki/Brainfuck>

Brainfuck - Homepage: <https://brainfuck.org/>

Brainfuck - Wikipedia: <https://en.wikipedia.org/wiki/Brainfuck>
