# Brainfuck

The brainfuck programming language is an esoteric (weird and unusual) programming language. It was created by Urban Müller in 1993.[1][2] It has eight instructions (commands) which operate (do things on) a tape.[1] Instructions are done one by one, in order.[1] The tape has multiple sections.[1] Each section is a number.[1][2] Each section is, in the beginning, zero.[1] Brainfuck is like a Turing machine. [1]

## Instruction table

Instruction Action
+ Add one to the current tape section.
- Subtract one from the current tape section.
< Move to the tape section to the left of the current one.
> Move to the tape section to right left of the current one.
. Print the value of the current tape section as an ASCII symbol.
, Read an ASCII symbol into the current tape section as a number.
[ If the current tape section is zero, go to the matching ], skipping the instructions in between.
] If the current tape section is not zero, go back to the matching [, and do the code after it again.

## Examples

```[-]
```

If the current section is not zero, these three commands subtract one until the current section is zero. Otherwise, they leave it at zero.

```+++--
```

These five commands first add three to the current section. Then, they subtract two from the current section. Since ${\displaystyle n+3-2=n+1}$, these five commands are the same as "+" alone.

## Derivatives

As a result of brainfuck's fame, many derivatives (versions) of brainfuck have been created. These include Brain-Flak,[3] pbrain,[4] and tinyBF.[5] Most are also Turing complete, just like brainfuck.

## References

1. "brainfuck - Esolang". esolangs.org. Retrieved 2022-04-23.
2. 262588213843476. "Basics of BrainFuck". Gist. Retrieved 2022-04-23.`{{cite web}}`: CS1 maint: numeric names: authors list (link)
3. "Brain-Flak - Esolang". esolangs.org. Retrieved 2022-04-24.
4. "pbrain - Esolang". esolangs.org. Retrieved 2022-04-24.
5. "tinyBF - Esolang". esolangs.org. Retrieved 2022-04-24.