
-----------------------------------
frank26080115
Mon Dec 10, 2007 6:56 pm

Brainfuck Interpreter
-----------------------------------
I made a simple Brainfuck interpreter, this is a step towards a microcontroller assembly/machine code simulation.
Learn about Brainfuck and its syntax here:
http://en.wikipedia.org/wiki/Brainfuck

Note that my version allows variables and pointers to decrement from 0 to 255 and increment from 255 to 0


setscreen ("graphics:1000,600;position:center,center;offscreenonly;title:Brainfuck") %;nobuttonbar")
const maxAddress := 255
var address : array 0 .. maxAddress of int
var _pointer : int
var code : string := ""

var ch : string (1)

var loopCounter, location : int
var finished, _return : boolean

var chars : array char of boolean

fcn getInput (fieldName, starting : string, maxLength : int, interger : boolean) : string
    var character : string (1)
    var cursorLoc : int := 0
    var output : string := starting
    var legalString : string := " ~!@#$%\^&*()_+`1234567890-=qwertyuiop

for an example, "+[,.]" will become something like notepad, "+[.+]" will show all printable characters and then exit the loop, "+[.+.+]" will loop forever while printing all printable characters, have fun[/syntax]

-----------------------------------
CodeMonkey2000
Mon Dec 10, 2007 7:11 pm

RE:Brainfuck Interpreter
-----------------------------------
0_o Holy crap. This is amazing. But I still don't plan on ever using BF.

-----------------------------------
Ultrahex
Mon Dec 10, 2007 7:25 pm

Re: Brainfuck Interpreter
-----------------------------------
Overall the program is excellent.

You should make it more "clean", so its not as over cumbersomely (hehe, no clue if that is correct english). For Example:

Welcome to the Brainfuck Interpreter by Frank26080115

Input Below:

:: ++++++

note that i may be the only one annoyed because I like to have clean looking interfaces, and most people that use interpreters understand that it is an input field etc... Just Some Ideas :)

-----------------------------------
Tony
Mon Dec 10, 2007 7:48 pm

RE:Brainfuck Interpreter
-----------------------------------
this is quite cool :) +bits

-----------------------------------
shakin cookie
Sat Jan 05, 2008 11:15 am

RE:Brainfuck Interpreter
-----------------------------------
I do not understand how this works...

-----------------------------------
StealthArcher
Sun Jan 13, 2008 10:17 pm

RE:Brainfuck Interpreter
-----------------------------------
You have to know what Brain**** is first really.

Then you will be amazed.

And I am amazed. +bits
