BrainFizuck

Community Forums/Showcase/BrainFizuck

GW(Posted 2004) [#1]
BrainF*ck interpreter.




Bot Builder(Posted 2004) [#2]
Probably the most useless thing written in blitz :P

Ah well, Kinda cool :D


GW(Posted 2004) [#3]
Here is a serpenski triangle :-)



alter the code with this"

Graphics 80*10,45*10,0,2

;optional
FIL =ReadFile("C:\BF.TXT")
Repeat
	CODE$=CODE$+ReadLine(FIL)
Until Eof(FIL)




Bot Builder(Posted 2004) [#4]
Thats more like it :D

My interpreter is already better though :P (well, once I work out variables)


GW(Posted 2004) [#5]
this one takes input from the console (0 terminated) and prints out a BF program that prints the BF source ;-)

+++++[>+++++++++<-],[[>--.++>+<<-]>+.->[<.>-]<<,]>>>>>>>>>++++++++++.



Bot Builder(Posted 2004) [#6]
Now all you have to do is write BF in BF :D


Bot Builder(Posted 2004) [#7]
lol how do you enter code?


GW(Posted 2004) [#8]
Instead of having the input from the console, get each char from a file stream.


sswift(Posted 2004) [#9]
Huh... Looking at the source code above... > and < move forward or back one location in an array, while + and - incremenet or decrement the value at the current location.

. writes a character to a string called OUT$, unless that character is a line feed, (10) in which case it prints the data contained in OUT$ and clears OUT$.

, gets keyboard input and writes the key to the current array location.

And [ and ] appear to be some kind of loop but I can't figure out how the hell it works.


Interesting. But useless. :-)


GW(Posted 2004) [#10]
"[" is simply a loop initiator
"]" will throw the pointer back to its matching "[" if the
value at the current pointer is not 0. Loops can be nested.

This program "++++++[-]" increments the value of the current pointer by 6 then enters a loop that decriments the value at that pointer until it hits 0 and the program ends.
The neat thing about it is that its a Turing complete language. you could write OO programs in it if you wanted to. not sure why anyone would though ;)


Kanati(Posted 2004) [#11]
I forgot all about that language...