Brainf*** is a programming language that is so simple, it's hard!
It only has eight commands, in the form of eight ASCII characters. They are:
- >
- increment the data pointer (to point to the next cell to the right).
- <
- decrement the data pointer (to point to the next cell to the left).
- +
- increment (increase by one) the byte at the data pointer.
- -
- decrement (decrease by one) the byte at the data pointer.
- .
- output the byte at the data pointer.
- ,
- accept one byte of input, storing its value in the byte at the data pointer.
- [
- if the byte at the data pointer is zero, then instead of moving the instruction pointer forward to the next command, jump it forward to the command after the matching ] command.
- ]
- if the byte at the data pointer is nonzero, then instead of moving the instruction pointer forward to the next command, jump it back to the command after the matching [ command.
Here is an example program, the classic "Hello World!" program.
++++++++++
[
>+++++++
>++++++++++
>+++
>+
<<<<-
]
>++.
>+.
+++++++.
.
+++.
>++.
<<+++++++++++++++.
>.
+++.
------.
--------.
>+++.
>.
Of course, that is to enhance readability. It could also be written like this.
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+++.>.
There is a Wikipedia article about it. Check it out!
LOLCODE is Cheezburger as a programming language, basically. Its homepage: lolcode. com .
Here is the classic "Hello World!" program in LOLCODE.
HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE
I have no idea how LOLCODE works. Please look into that.
Can you think of other unorthodox programming languages?
:ClrHome:Disp "HOW DOES A","MATHEMATICIAN","LOSE WEIGHT?
:Pause "
:Pause "BINOMIALS!
:Pause "(BUY NO MEALS)":ClrHome