Tool to decode/encode in Brainfuck, an esoteric programming language consisting of characters like ++++---[+++].
Brainfuck - dCode
Tag(s) : Programming Language
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
Brainfuck (or BF or Brainf**k) is a minimalist programmation language that takes its name from two words that refer to a kind of cerebral masturbation.
Brain Fuck is not a proper encryption system, but rather a programming language that has been obfuscated. Encoding consists in writing machine code (input) that returns text as output.
Machine operations are:
> : increment the pointer (+1),
< : decrement the pointer (-1),
+ : increment the byte in the memory cell where the pointer is located,
- : decrement the byte in the memory cell where the pointer is located,
. : send the value of the pointed byte as output (treated as an ASCII value),
, : insert an input byte (user input) in the memory cell where the pointer is located (ASCII value),
[ : if the pointed byte is 0 then jump to instruction after the corresponding ],
] : if the pointed byte is not 0 then jump to the instruction after the corresponding [
In order to shorten the code, an alternative syntax exists (shortcut BF) that uses i for increment, d for decrement, r for right, l for left each associated to a number to indicate the repetition of the operation.
Example: i4 (+ 4 times) => ++++ , d3 (- 3 times) => ---, r5 => >>>>>, l4 => <<<<
Once again it is not an decryption but rather an interpretation of the code (or brainfuck translator that turn brainfuck to text). With an interpreter and a brainfuck compiler, each byte send as output is then a plain text character.
Replace iX, dX, rX and lX by respectively +, -, >, < X times to get back the original BF code.
The message is composed of the 8 characters ><+-.,[] (opening chevron, closing chevron, plus, minus, point, comma, open bracket, closing bracket)
The character [ should appear as many times as the character ]
The characters + and - are the most common and usually appear to +++ group or ---. It makes little sense (but possible) to have + and - consecutively.
The characters . and , are less frequent.
Many variants of brainfuck have become esoteric languages such as Alphuck, Binaryfuck, Ook, Blub, Pikalang, Reversefuck or Spoon.
BF language was created by Urban Müller in 1993.
dCode retains ownership of the "Brainfuck" source code. Except explicit open source licence (indicated Creative Commons / free), the "Brainfuck" algorithm, the applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or the "Brainfuck" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and all data download, script, or API access for "Brainfuck" are not public, same for offline use on PC, tablet, iPhone or Android !
The copy-paste of the page "Brainfuck" or any of its results, is allowed as long as you cite the online source
Reminder : dCode is free to use.
The copy-paste of the page "Brainfuck" or any of its results, is allowed as long as you cite dCode!
Cite as source (bibliography):
Brainfuck on dCode.fr [online website], retrieved on 2022-07-04,