Brainfuck is an esoteric programming language created in 1993 by Urban Müller. It operates on a simple model: an array of memory cells and a data pointer.
| Command | Description |
|---|---|
> |
Move the data pointer to the right |
< |
Move the data pointer to the left |
+ |
Increment the memory cell at the data pointer |
- |
Decrement the memory cell at the data pointer |
. |
Output the character at the data pointer |
, |
Input a character and store it at the data pointer |
[ |
Jump past the matching ] if the cell at the data pointer is 0 |
] |
Jump back to the matching [ if the cell at the data pointer is not 0 |
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.
++ Cell 0 = 2 >+++ Cell 1 = 3 [<+>-] Add cell 1 to cell 0 < Move back to cell 0 ++++++++++++++++++++++++++++++++++++++++++++++++. Add 48 and output (to get ASCII '5')
,[.,] Read input and echo it back until EOF
+++ Cell 0 = 3 >++++ Cell 1 = 4 [ Start loop <+++> Add 3 to cell 0 for each iteration - Decrement cell 1 ] End loop when cell 1 is 0 < Move to cell 0 ++++++++++++++++++++++++++++++++++++++++++++++++. Add 48 and output result
[] for repetitive operations