+ Reply to Thread
Results 1 to 4 of 4

Thread: Simple things made complex

  1. #1
    Not a bot itsbth's Avatar
    Join Date
    Feb 2007
    Location
    Norway
    Posts
    1,173

    Default Simple things made complex

    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)
    Attached Files Attached Files

  2. #2
    Wire Sofaking Whodunnit's Avatar
    Join Date
    Jan 2008
    Location
    New Zealand, Ackl
    Posts
    636

    Default Re: Simple things made complex

    Hahahaha, excellent, i loved this when i messed around with it on my PC a while back.

  3. #3
    Spucatum Tauri Bull's Avatar
    Join Date
    Jun 2008
    Location
    Finland
    Posts
    6,010

    Default Re: Simple things made complex

    You bad boy. (Look at screenshot 2, 3 , 4)

    Great calculator though.. I needed one of those
    My signature has a point.
    Quote Originally Posted by Squeakyneb View Post
    when l3ulletje says do it, do it.
    That

    Quote Originally Posted by Anticept View Post
    By the way, Bull is in charge.

  4. #4
    Wire Sofaking -=Fox=-'s Avatar
    Join Date
    Feb 2007
    Location
    Somewhere in my Mind...
    Posts
    1,846
    Blog Entries
    7

    Default Re: Simple things made complex

    Woots! Brainfuck FTW!
    http://tiny.cc/OMFGWTFBBQ

    Best People On Wiremod!

    Black Phoenix, Azrael, Jat Goodwin, Magos Mechanicus, ITSBTH, Fizyk, g33v3s,tuusita, InfectiousFight, ief015

    Pointless things that are pointless, are pointlessly pointless, therefore pointlessness is pointless.
    So pointlessly pointing out the pointlessness of this pointless signature is utterly pointless.
    My IQ is 123

+ Reply to Thread

Similar Threads

  1. Complex stuff made easy
    By Black Phoenix in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 16
    Last Post: 01-21-2009, 11:04 AM
  2. Replies: 13
    Last Post: 11-29-2008, 05:38 PM
  3. Help! I need someone to help me with a complex math problem
    By Meatloaftwo in forum Wiremod General Chat
    Replies: 2
    Last Post: 12-01-2007, 10:10 PM
  4. The most complex way to make a sphere...
    By Dimencia in forum CPU, GPU, and Hi-speed Discussion & Help
    Replies: 7
    Last Post: 04-07-2007, 08:30 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
proceed-collector
proceed-collector
proceed-collector
proceed-collector
linguistic-parrots
linguistic-parrots
linguistic-parrots
linguistic-parrots