What am I talking about? A BrainFuck interpreter of course!
Why spend ages learning zASM just so can use loops when you can use this little baby? Oh, and did I mention? It comes complete with a BUILT-IN CODE EDITOR! So what are you waiting for? Order your very own E2 BrainFuck interpreter now! Only $199.99! Order within one µs, and receive FREE SHIPPING*!
*Certain restrictions apply. Only available in a one kilometer radius around producer. E2BF Inc. is not responsible for any brain damage, severed heads or general madness caused by careless use of this product.
And now, images! (See below for more detailed description)
Add one to the input: +[>,+.<]




Editor:

Interpreter:

Back side:

Side view:

Simple counter: [+.]

Add five: +[>,+++++.<]

Two interconnected add five:


So, how does this all work?
The core is an E2 gate, and a 64k ram chip (only 3072 "bytes" (floats) is actually used).
The ram is divided in three:
First 1024 bytes: Program
Second 1024 bytes: Data
Third 1024 bytes: "Call" stack (oversized, I know)
The gate has one input (called In) and one output (called Out) that can be used from the program (using , and . respectively).
"Enough with this technical crap, how do I use it?"
Glad you asked!
First go to the back and reset the memory it using the red button (See Ill. 1.1).
Illustration 1.1:

Then input the program using the controls on the editor (See Ill. 1.2).
Illustration 1.2:

Then press the clear button on the main panel (See Ill. 1.3) and the program should start automatically.
Illustration 1.3:

That's it. You are now capable of operating the E2BF Inc. Expression 2 BrainFuck Interpreter!
Code:
Code:
@name BrainFuck Interpreter
@inputs Memory:wirelink In Reset
@outputs Out
@persist Pos Address StackPos Tmp:string Val
interval(100)
if(first() | Reset) {
Pos = 0
Address = 0
StackPos = 0
}
Tmp = toChar(Memory:readCell(Pos))
Val = Memory:readCell(1024 + Address)
if(Tmp == "+") {
Memory:writeCell(1024 + Address, Val + 1)
}
elseif(Tmp == "-") {
Memory:writeCell(1024 + Address, Val - 1)
}
elseif(Tmp == ">") {
Address += 1
}
elseif(Tmp == "<") {
Address -= 1
}
elseif(Tmp == ",") {
Memory:writeCell(1024 + Address, In)
}
elseif(Tmp == ".") {
Out = Val
}
elseif(Tmp == "[") {
Memory:writeCell(3072 - StackPos, Pos)
StackPos += 1
}
if(Tmp == "]") {
StackPos -= 1
Pos = Memory:readCell(3072 - StackPos)
}
else {
Pos += 1
}
Address = (Address % 1024)
Bookmarks