More inputs on some wiring gates

This is a more QoL based idea and loosely based off of @PirahSet’s Signal collector gate suggestion as well as a conversation with @Gargoyle on Discord.

There are some gates that accept 2 inputs that are often chained together due to, well, having many inputs. Here’s an example:
image

Instead of creating a whole new gate just to circumvent this, why not allow the AND, NAND, OR, NOR and XNOR gates have any amount of inputs (or some high limit like 10 inputs, for example)? This can already be done programmatically (small example below):
AND: if (input1 && input2 && input3 && ...etc)
NAND: if (!input1 || !input2 || !input3 ||...etc)
OR: if (input1 || input2 || input3 || ...etc)
NOR: if (!input1 && !input2 && !input3 && ...etc)
XNOR: if ((input1 && input2 && input3 && ...etc) || (!input1 && !input2 && !input3 && ...etc))

XOR likely wouldn’t work with more than 2 inputs though.

The item descriptions could be changed to reflect “all inputs”, “at least an input”, “one input”, etc.

This would also likely be more efficient in general, because less gates would be used as well as it all being done in a single statement if that makes sense.

5 Likes

XNOR can be replaced with if(input1 == input2 == input3…)

And NAND with if(!(input1 && input2 && input3…))

XOR outputs 1 if the inputs are different, and they can’t be different with more than 2 inputs

You can use a different interpretation though.

  1. If only 1 input is on
  2. If only 1 input is off
  3. If at least 1 input is different

All of them would give different results with more than 2 inputs, but the same with 2 inputs.

Edit: In my opinion the first one is the best one, because it fits the description of an exclusive or. Meaning either this input, or that input, or that one, and not more than one.

The code segment was just an example although yeah, those would be more efficient.

XOR:
I don’t know about those interpretations and it might become even more confusing to use, but at least it’d match the other ones should this change be done.

1 Like