Official Soldat Forums

Server Talk => Scripting Releases => Topic started by: DorkeyDear on March 18, 2008, 09:42:51 pm

Title: Brainfeck Code Interpreter
Post by: DorkeyDear on March 18, 2008, 09:42:51 pm
Script Name: Brainfeck Code Interpreter
Script Description: Using Brainfeck language (http://www.google.com/search?hl=en&q=Brainfeck&btnG=Google+Search), returns a string. (Example: IntrBF('[.+]'): (a list of all characters in the ASCII chart)) This is for scripters, not server owners. If you wish to use this script in your script, feel free to, but please note my name.
Original Author: Curt
Core Version: 2.6.3
Code: http://nopaste.org/p/aweEUqp1k

Due to SF's "bad word" filter, you may need to replace the "e" with a "u" on the Google search.

Here is all you can do:
+ Increments the value at the pointer
- Decrements the value at the pointer
> Increments the pointer
< Decrements the pointer
[ Start loop
] End loop; return to start loop if value at pointer is not 0
. Adds value at the pointer (as a character) to the resulting string
, Not included due to inability to type in the console

It helps to refer to http://www.asciitable.com/

Examples:
+++++[>++++++++++++++<-]++.+. will return "HI"
Basically this is Chr(5*14+2) + Chr((5*14+2) + 1); so thats a way to multiply instead of having 72 +s in a row.
Title: Re: Brainfeck Code Interpreter
Post by: rhide on March 19, 2008, 07:43:05 pm
LOL  ;D

still gj  ;)
Title: Re: Brainfeck Code Interpreter
Post by: chutem on March 20, 2008, 06:44:17 pm
I have no idea why someone would write like that...
Title: Re: Brainfeck Code Interpreter
Post by: danmer on March 21, 2008, 05:29:44 pm
NO FüCKING WAY :o
GJ :P