+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: A really quick gate someone could make? - The add/and gate!

  1. #1
    Wire Amateur conman420's Avatar
    Join Date
    Feb 2007
    Location
    UK
    Posts
    98

    Thumbs up

    Hello all I would like to request a simple gate that would function similar to a transistor. It would be a variable logic and gate. Here is a kind of truth table.

    A | B | OUT
    _________
    5 | 20 | 25
    0 | 110 | 0
    20 | 0 | 0
    13 | 15 | 28

    You get the idea it is useful for a machine to give variable speeds to a thruster. Also maybe an add OR? Because if an or gate gets an input it just outputs 1 and this would let moving wire contraptions have more flexible speeds.

    Say you have a target 90 degrees off from an auto turret the turret would move faster to get to the target then if it was a couple of degrees out. This would be very useful to me and maybe to other people so can someone give it a go?

  2. #2
    That furred thing Black Phoenix's Avatar
    Join Date
    Feb 2007
    Location
    Kyiv, Ukraine
    Posts
    3,565

    Default

    Uhm, tell more. Does it work like "if both are non-zero then result = sum"?
    I'm a wire-crazy person with a tail.

    Take a daily journey into my brain

    D2K5

  3. #3
    Wirererer handcrafted's Avatar
    Join Date
    Mar 2007
    Location
    Denmark
    Posts
    215

    Red face

    Yeah, like if true then add, else false
    Python
    if A && B:<blockquote>return=A+B</blockquote>

    Lua might look nearly the same.
    The Wire Wiki, please try there before asking.

    Sorry for asking but where can I edit my signature?

  4. #4
    Administrator Tad2020's Avatar
    Join Date
    Feb 2007
    Location
    California, USA
    Posts
    1,498

    Default

    This might work (untested):

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>
    GateActions["and/and"] = {
    group = "Arithmetic",
    name = "And/And",
    inputs = { "A", "B"},
    output = function(gate, A, B)
    if ((A) and (A <= 0)) or ((B) and (B <= 0)) then return 0 end
    return A+B
    end,
    label = function(Out, A, B)
    return A.." and/and "..B.." = "..Out
    end
    }
    </div>
    "Our death ray doesn't seem to be working. I'm standing right in it, and I'm not dead yet." - Jamie Hyneman
    "Yes, managing the anonymous activity of the entire Internet is a challenge. Shoving the entire universe into a mason jar for use as a personal flashlight would also be a pesky bother." - Karl, BBR

    WIREMOD WILL NOT WORK ON YOUR FACE! BUT IT DOES ON YOUR MOM :shifty:

  5. #5
    Wire Amateur conman420's Avatar
    Join Date
    Feb 2007
    Location
    UK
    Posts
    98

    Cool

    This might work (untested):

    <div class='codetop'>CODE
    <div class='codemain' style='height:200px;white-spacere;overflow:auto'>
    GateActions["and/and"] = {
    group = "Arithmetic",
    name = "And/And",
    inputs = { "A", "B"},
    output = function(gate, A,
    if ((A) and (A <= 0)) or (( and (B <= 0)) then return 0 end
    return A+B
    end,
    label = function(Out, A,
    return A.." and/and "..B.." = "..Out
    end
    }
    </div>[/b][/quote]


    ok I will test this later.

    Thank you

  6. #6
    Wirererer handcrafted's Avatar
    Join Date
    Mar 2007
    Location
    Denmark
    Posts
    215

    Default

    works
    The Wire Wiki, please try there before asking.

    Sorry for asking but where can I edit my signature?

  7. #7
    Administrator Tad2020's Avatar
    Join Date
    Feb 2007
    Location
    California, USA
    Posts
    1,498

    Default

    I called it an Arithmetic gate cause it seemed like a special case Add.
    "Our death ray doesn't seem to be working. I'm standing right in it, and I'm not dead yet." - Jamie Hyneman
    "Yes, managing the anonymous activity of the entire Internet is a challenge. Shoving the entire universe into a mason jar for use as a personal flashlight would also be a pesky bother." - Karl, BBR

    WIREMOD WILL NOT WORK ON YOUR FACE! BUT IT DOES ON YOUR MOM :shifty:

  8. #8
    Wire Amateur conman420's Avatar
    Join Date
    Feb 2007
    Location
    UK
    Posts
    98

    Default

    Lol it is add/and not and/and I changed that on my version just to let you know.
    Have you added to SVN?

  9. #9
    Wire Amateur anzbevrct's Avatar
    Join Date
    Feb 2007
    Location
    Antwerp - Belgium
    Posts
    64

    Default

    Hey,
    This sounds interesting, but I don&#39;t fully understand how you could control speeds with this thing...

    Can you give an example of some applications you have in mind?

  10. #10
    Administrator Tad2020's Avatar
    Join Date
    Feb 2007
    Location
    California, USA
    Posts
    1,498

    Default

    Lol it is add/and not and/and I changed that on my version just to let you know.
    Have you added to SVN?[/b]

    Bah, only one letter off. Shouldn&#39;t it be and/add? Cause if A and B then A+B. I can add it to the svn.
    "Our death ray doesn't seem to be working. I'm standing right in it, and I'm not dead yet." - Jamie Hyneman
    "Yes, managing the anonymous activity of the entire Internet is a challenge. Shoving the entire universe into a mason jar for use as a personal flashlight would also be a pesky bother." - Karl, BBR

    WIREMOD WILL NOT WORK ON YOUR FACE! BUT IT DOES ON YOUR MOM :shifty:

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. [REQUEST] How to make a expression gate that has a timer and a smoother function
    By funkake in forum Gate Nostalgia (Old School Wiring) Discussion & Help
    Replies: 5
    Last Post: 09-17-2008, 11:05 PM
  2. Quick Question E GATE
    By 0blackmage0 in forum Installation and Malfunctions Support
    Replies: 1
    Last Post: 04-01-2008, 01:02 PM
  3. Quick Search not so quick
    By seth1010 in forum Wiremod Website Chat
    Replies: 4
    Last Post: 03-23-2008, 07:35 AM
  4. Quick Expression Gate question...
    By Hysteria100 in forum Installation and Malfunctions Support
    Replies: 3
    Last Post: 10-24-2007, 12:50 PM

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