Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: BrainF***: the oddest programming language...  (Read 1971 times)

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
BrainF***: the oddest programming language...
« on: November 12, 2008, 07:54:34 pm »

I don't personally like the name, but it is pretty interesting.
Basically, it is a huge array of chars, and there are only 8 instructions:
+  increment the current data
-  decrement the current data
>  move forward one array position
<  move backward one array position
,  get a char as input and store it in the current array position
.  output the char at the current array position
[  if current data contains 0, jump forward to matching ]
]  if current data contains non-zero, jump backwards to matching [

{wikipedia's view}
My interpreter.


It is quite neat, since you can write a program to output all of the ASCII chars VERY quickly..
Code: [Select]
.+[.+],
Or the standard input-to-output:
Code: [Select]
,[.,]
Edit:
I would like to note how quick it is to use this to convert line breaks(if it does not run in binary read mode) from unreadable to easily read, perfect for those open source things that use those annoying things that should be \n but aren't...
« Last Edit: November 12, 2008, 07:56:32 pm by qwertyuiopas »
Logged
Eh?
Eh!