Skip to content

Latest commit

 

History

History
26 lines (21 loc) · 630 Bytes

brainfuck.md

File metadata and controls

26 lines (21 loc) · 630 Bytes

Brainfuck

Brainfuck is the most famous esoteric programming language.

The basic algorithm

Contibuted by: pufe

Without comments

,[>,]++++++[->++++++++<]<[[->>+<]>[<]<[->>-<]>[<]<]>>.

With comments

,[>,] read until EOF
++++++[->++++++++<] sets answer to ASCII 0
< last char read
[ while not zero
[->>+<] if greater than zero then decrement once and increments answer
>[<]< returns to last char
[->>-<] if greater than zero then decrement once and decrements answer
>[<]< returns to last char
] end while
>>. prints answer