Philosophical Multicore

Sometimes controversial, sometimes fallacious, sometimes thought-provoking, and always fun.


Posted by Michael Dickens on September 29, 2009

WARNING: Offensive language ahead! That is, if you’re offended by a completely logical name that makes eloquent usage of the English language.

Brainfuck is just about the most awesome programming language ever invented. It consists of only eight commands, but is still Turing complete. So what are these infamous eight commands?

Imagine an array of bytes, and a single pointer that moves along these bytes.

> move the pointer to the right
< move the pointer to the left
+ add 1 to the value under the pointer
– subtract 1 from the value under the pointer
, take one byte of input
. print a byte as output
[ if the byte at the pointer equals zero, skip to the matching ]
] if the byte at the pointer is not zero, go back to the matching [

[ and ] act like a while loop:

while (byte != 0) {


It is so tiny, and yet this little language can do so much. Anything you can do in another language, you can do in Brainfuck. Jon Ripley even wrote a text-based game in Brainfuck. That’s crazy. The first few lines of the code look like this:


And there are 30,000 lines of this. Wow.


2 Responses to “Brainf*ck”

  1. phynnboi said

    I look forward to seeing your implementation of your keyboard layout program in Brainfuck. 😛

  2. Mikemc said

    When I try to take the small box of matches, it says that I ‘need to specify an item’. It I EXAMINE the table, I am now on ‘Dirt Path North’.

    – Mike

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: