This is a very interesting programming language, having ONLY 8 commands. It basically works that way that it takes up an array of data (you can set up how much, I think about 32768 was default). Everything can be made by moving around in the array and processing data. Here is an example of a "Hello World." program in Brainfuck.
Quote++++++++++
[>+++++++>++++++++++>+++>+<<<<-] The initial loop to set up useful values in the array
>++. Print 'H'
>+. Print 'e'
+++++++. Print 'l'
. Print 'l'
+++. Print 'o'
>++. Print ' '
<<+++++++++++++++. Print 'W'
>. Print 'o'
+++. Print 'r'
------. Print 'l'
--------. Print 'd'
>+. Print '!'
>. Print newline
The commands are:
Quote> increment the pointer (to point to the next cell to the right).
< decrement the pointer (to point to the next cell to the left).
+ increment (increase by one) the byte at the pointer.
- decrement (decrease by one) the byte at the pointer.
. output the value of the byte at the pointer.
, accept one byte of input, storing its value in the byte at the pointer.
[ jump forward to the command after the corresponding ] if the byte at the pointer is zero.
] jump back to the command after the corresponding [ if the byte at the pointer is nonzero.
Any other characters are considered comments. Basically the C/C++ equivalents are:
Quote> ++ptr;
< --ptr;
+ ++*ptr;
- --*ptr;
. putchar(*ptr);
, *ptr=getchar();
[ while (*ptr) {
] }
More info:
http://en.wikipedia.org/wiki/Brainfuck
Lolz @ this language :tpg:
Wonder why they call it Brainfuck ::)
I am definitely not going to use this, but it gave a good laugh ;8
Totally. I also check what "Obfuscated coding" is. Totally lolage. xD
http://en.wikipedia.org/wiki/Obfuscated_code
It really is :tpg:
Holy mother of lord! What the hell? This is the most weirdest language, but I understand it a lot better than any other language...wait till my IT teacher hears about this ;D
~Winged
Hey guys I use this more then lisp, c#, and liberty basic combined! (i don't know any of them...)
That thing is just plain weird. o.O I really haven't seen anything less efficient than that.
Brainfuck indeed.
Well, as stated in wiki it isn't supposed to be efficient, but to be a little challenge for programmers.
LMAO! I will have to try this someday, when I am more experienced in programming. XD