Page 1 of 1

Signal pass through help?

Posted: Tue Aug 01, 2017 6:03 pm
by The Eriksonn
I need a device with 2 inputs and an output that will pass the first input if that item exist in the second.

Example:
first input: 100 iron, 36 Circuits, 50 copper, 200 gears
second input: 1 iron, 1 gear
expected output: 100 iron, 200 gears

item amount and type is unknown(exept that it is Always 1 of each in the second input and no negatives anywhere)

any ideas? :?

Re: Signal pass through help?

Posted: Tue Aug 01, 2017 7:19 pm
by DaveMcW
Input 1 Each + -2147483648 → Input 3
Input 2 Each * -2147483648 → Input 3
Input 3 Each > 0 → Output

When the signals match, the two -2147483648's cancel out due to integer overflow.

Re: Signal pass through help?

Posted: Tue Aug 01, 2017 7:53 pm
by The Eriksonn
it worked, yay :D

I am not using overflows that much becauce it kind of feels a bit cheaty... :?

but i guess i could start using them more to see what happens...