Electric gates : not, and

  • asdf123
    5th Oct 2012 Member 2 Permalink

    Why didn't anyone think of this?

     

    Saves sooo much space!!!!

     

    XD

     

    And gate:

     

    tpt.el.bran.name="ANDG"
    tpt.el.bran.description="AND gate."
    tpt.el.bran.heat=273.15
    tpt.el.bran.enabled=1
    math.randomseed(os.time())
    function notgate (i,x,y,s,n)
    tpt.create(x+1,y,"insl")
    tpt.create(x,y+1,"insl")
    tpt.create(x+1,y-1,"metl")
    tpt.create(x+1,y+1,"metl")
    tpt.create(x,y-1,"insl")
    tpt.create(x-1,y,"insl")
    tpt.create(x-1,y+1,"insl")
    tpt.create(x-1,y-1,"metl")
    a=tpt.get_property("type",x+1,y-1)
    b=tpt.get_property("type",x-1,y-1)
    if a==tpt.el.sprk.id and b==tpt.el.sprk.id then
    tpt.create(x+1,y+1,"sprk")
    end
    end
    tpt.element_func (notgate, tpt.el.bran.id)

     

     

    Not(Xand)

     

    tpt.el.bran.name="NOTG"
    tpt.el.bran.description="XAND gate."
    tpt.el.bran.heat=273.15
    tpt.el.bran.enabled=1
    math.randomseed(os.time())
    function notgate (i,x,y,s,n)
    tpt.create(x+1,y,"insl")
    tpt.create(x,y+1,"insl")
    tpt.create(x+1,y-1,"metl")
    tpt.create(x+1,y+1,"metl")
    tpt.create(x,y-1,"insl")
    tpt.create(x-1,y,"insl")
    tpt.create(x-1,y+1,"insl")
    tpt.create(x-1,y-1,"metl")
    a=tpt.get_property("type",x+1,y-1)
    b=tpt.get_property("type",x-1,y-1)
    if a==tpt.el.sprk.id and b~=tpt.el.sprk.id then
    tpt.create(x+1,y+1,"sprk")
    end
    end
    tpt.element_func (notgate, tpt.el.bran.id)

  • Box-Poorsoft
    5th Oct 2012 Banned 0 Permalink
    This post is hidden because the user is banned
  • Jallibad
    5th Oct 2012 Member 0 Permalink

    @asdf123 (View Post)

     I've actually done something similar to that, but it doesn't work in tpt++.

  • carrots123
    5th Oct 2012 Member 0 Permalink

    @Box-Poorsoft

    But aren't the smallest ones at least 5x5? I've tried to make a smaller one, but never succeeded.

  • mniip
    5th Oct 2012 Developer 1 Permalink
    look for my EMDL script
  • asdf123
    9th Oct 2012 Member 0 Permalink

    How does it work?

    don't really get that description.

  • Niven
    10th Oct 2012 Member 0 Permalink
    @carrots123 (View Post)
    They can be smaller. Here's a save of mine with gates smaller than 5x5. Use them if you want


    *unfortunately, the wire XOR gate may work but it isn't very practical since the sparks have to be at EXACTLY the same time for it to work properly
  • timpfeifer
    28th Dec 2012 Member 0 Permalink

    it's don't works for me

  • snail
    28th Dec 2012 Member 0 Permalink

    @timpfeifer (View Post)

     Don't necro.

  • Spock
    28th Dec 2012 Member 0 Permalink
    I recommend you use the search bar for what is a necro, and check the forums rules.

    I am just intending to save you from a (possible) bannable offence.