Brainfuck Interpreter - Let's just say I get bored.

Hey there! Throughout the time you have spent coding, you have surely heard about the esoteric language named Brainfuck. If you havn’t, well this is the time for me to explain. Brainfuck, created by Urban Müller in 1993, is a language that is absolutely useless, and is very complicated to understand. It is composed of 8 operators : ><±,.
I’m not going to go much more into detail here, if you want to read up on it there is a great article here : http://en.wikipedia.org/wiki/Brainfuck.

Today, I got bored and spent some time discovering this language and creating an interpreter for it, and when I did I saw the massive potential it had for coders here. My code isn’t the cleanest, and I couldn’t be bothered with metatables, but for what it’s actually for, I’m not going to say sorry for that.

Here is the code : http://pastebin.com/drGVB2ME


 Interpreter that can interpret stack based code here : 

http://pastebin.com/e8vTdGaG

Here is the Hello World! example code taken from Wikipedia


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

Lua code to run it :
[Lua]
local HelloWorld = BrainFuck.NewInstance( )
HelloWorld:Set( “++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++…+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.” )
HelloWorld:Interpret( )
[/Lua]

Output:


Hello World!

There are some problems with the data input operator, but I’m working on that
Well, I have no idea what this could be used for, but it was fun making it.