Penguin

Differences between current version and revision by previous author of Brainf*ck.

Other diffs: Previous Major Revision, Previous Revision, or view the Annotated Edit History

Newer page: version 16 Last edited on Tuesday, November 9, 2004 12:44:56 am by AristotlePagaltzis
Older page: version 14 Last edited on Thursday, May 27, 2004 10:18:13 pm by DanielCristofani Revert
@@ -1,50 +1,63 @@
-An interesting [ ProgrammingLanguage]. It is very easy to learn, but can get extremely confusing. 
+An interesting ProgrammingLanguage that is very easy to learn, but can get extremely confusing. 
  
-;: '' There's someone in my head, %%% but it's not me. %%% %%% -- Pink Floyd, Brain damage'' 
+ ''There's someone in my head,  
+ <br> but it's not me.''  
+  
+ -- Pink Floyd, '' Brain damage'' 
  
 The language has 8 different commands. They use a nameless pointer to manipulate an array of at least 30000 cells, all initially set to 0. The pointer starts at the left end of the array. 
-; + : Increment the value of the current cell by 1  
-; - : Decrement the value of the current cell by 1  
-; . : Print the current cell as a character to standard output [stdout(3)]  
-; , : Read a value from standard input to the current cell (these two use ASCII, with ten as newline) [stdin(3)]  
-; > : Move the pointer right one cell  
-; < : Move the pointer left one cell  
-; [ : Start of a loop. This is essentially a while loop which will keep iterating while the pointer points to a nonzero cell.  
-; ] : End of the while loop. The sequence between the square brackets will get executed whilst the while loop executes.  
  
-As they say about [Perl ]: ''There are many ways to skin a Camel''  
-This also holds true for [Brainf*ck ]. 
++:  
+ Increment the value of the current cell by 1  
+-:  
+ Decrement the value of the current cell by 1  
+.:  
+ Print the current cell as a character to standard output [stdout(3) ]  
+, :  
+ Read a value from standard input to the current cell (these two use ASCII, with ten as newline) [stdin(3)]  
+>:  
+ Move the pointer right one cell  
+<:  
+ Move the pointer left one cell  
+[:  
+ Start of a loop. This is essentially a while loop which will keep iterating while the pointer points to a nonzero cell.  
+ ]:  
+ End of the while loop. The sequence between the square brackets will get executed whilst the while loop executes
  
-Standard [Brainf*ck] thinks of every variable as an integer with a range of 0 through to 255. Different variables can be accessed by the < and > instructions. For example, the code:  
- ++>++++<  
-would mean the following :  
-* Increase the current variable by 2  
+As they say about [Perl]: ''There are many ways to skin a Camel''. This also holds true for [Brainf*ck].  
+  
+ Standard [Brainf*ck] thinks of every variable as an integer with a range of 0 through to 255. Different variables can be accessed by the < and > instructions. For example, <tt> ++>++++<</tt> means :  
+  
+* Increment the current variable twice  
 * Move to the next variable 
-* Increase this variable by
+* Increment it variable 4 times  
 * Move to the previous variable 
  
 After this bit of code, the variable we are currently referencing has a value of 2, and the next variable has a value of 4. 
  
 !!! Examples 
  
 Here's a [HelloWorld] program: 
  
- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.  
- +++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
- ++++++++++++++++++++++++++++++++++++++++++++.+++++++..+++.>++++++++++++++  
- ++++++++++++++++++.<<.>.+++.------.--------.  
- >>++++++++++. 
+<verbatim>  
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++.  
++++++++++++++++>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++  
+++++++++++++++++++++++++++++++++++++++++++++.+++++++..+++.>++++++++++++++  
+++++++++++++++++++.<<.>.+++.------.--------.  
+>>++++++++++.  
+</verbatim>  
  
+A big archive of brainfuck programs and implementations is at [http://esoteric.sange.fi/brainfuck/].  
  
-A big archive of brainfuck programs and implementations is at http://esoteric.sange.fi/brainfuck/ .  
-There's more info about the language on [this |http://www.muppetlabs.com/~breadbox/bf/] page and [this |http://www.hevanet.com/cristofd/brainfuck/] page
+You can read [ more info | http://www.muppetlabs.com/~breadbox/bf/] [about the language | http://www.hevanet.com/cristofd/brainfuck/]. 
  
 !!! Notes 
-The language ignores any character in the program source code which is not a valid brainfuck command. This allows us to put comments in our code, as long as we make sure we do not accidentally use one of the language constructs in our comments. Or comments can be placed in a [] block, at a point in the code where the pointer is known to be at a zero cell.  
  
-[GerwinVanDeSteeg ] is planning on writing his own Compiler and an Interpreter for this language sometime in the near future. There are many available already on the WorldWideWeb; to find one, try [Google]. 
+The language ignores any character in the program source code which is not a valid [Brainf*ck ] command. This allows us to put comments in our code, as long as we make sure we do not accidentally use one of the language constructs in our comments. Or comments can be placed in a <tt>[]</tt> block, at a point in the code where the pointer is known to be at a zero cell.  
+  
+GerwinVanDeSteeg is planning on writing his own [ Compiler] and an interpreter for this language sometime in the near future. There are many available already on the WorldWideWeb; to find one, try [Google]. 
  
-'' I've just written one. Insomnia has its own imperatives. Here you go: [brainfux0r.ml | http://www.wave.co.nz/~glyn/brainfux0r.ml]. It is written in [Ocaml ]. It has a compiler (it compiles to [C]), an imperative interpreter and a functional interpreter. The functional interpreter has an infinite Turing tape as memory. I wrote and rewrote this program several times to try out various Ocaml features. (I'm following the advice on StuffToCode.) --GlynWebster'' 
+''I've just written one. Insomnia has its own imperatives. Here you go: [brainfux0r.ml | http://www.wave.co.nz/~glyn/brainfux0r.ml]. It is written in [OCaml ]. It has a [Compiler] (it compiles to [C]), an imperative interpreter and a functional interpreter. The functional interpreter has an infinite Turing tape as memory. I wrote and rewrote this program several times to try out various [OCaml] features. (I'm following the advice on StuffToCode.) --GlynWebster'' 
  
 ---- 
 CategoryProgrammingLanguages, CategoryObfuscatedProgrammingLanguages