Signal pass through help?

This board is to show, discuss and archive useful combinator- and logic-creations.
Smart triggering, counters and sensors, useful circuitry, switching as an art :), computers.
Please provide if possible always a blueprint of your creation.
Post Reply
The Eriksonn
Fast Inserter
Fast Inserter
Posts: 230
Joined: Wed Jun 08, 2016 6:16 pm
Contact:

Signal pass through help?

Post by The Eriksonn » Tue Aug 01, 2017 6:03 pm

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? :?

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 2809
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Signal pass through help?

Post by DaveMcW » Tue Aug 01, 2017 7:19 pm

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.

The Eriksonn
Fast Inserter
Fast Inserter
Posts: 230
Joined: Wed Jun 08, 2016 6:16 pm
Contact:

Re: Signal pass through help?

Post by The Eriksonn » Tue Aug 01, 2017 7:53 pm

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...

Post Reply

Return to “Combinator Creations”

Who is online

Users browsing this forum: No registered users