I think I have a better solution to this, without jumping through loops.
All circuits in this blueprints can be fed with both green or red wires.
The blueprints:
Code: Select all
0eNrtXdtu4zYQ/RVDj61V8C4xWOxDi/atQFH0rQkMRWZiYW3JkORcsMi/d2inlnyRTEpM7E20D0Esy6MhZ8g5cw6d/e7dzldqmSdpObnNsm/e1ffqSuFd/Vt7qd+bqiLOk2WZZKl35f0VFYUqRkVyn0bzYnSXZ4vRtZek196ozOC3bFXCr9+UWibp/ShL58/wAz5QzqJyFOVqtMyKpEwe1ChJ4fa7ZF6q/Nq7Tv/JlqO5uitHPryzBCvpr1lZgvXXi5s7i+v07+R+pi/oJ6Xe2EviLN24vXFK+1w+LxU4+5Dk5QqujL00WugLmzv8eKbib94LfDadqifvCr/cjD2VluCY2phav3iepKvFrcrhhq0F/bAySks/zha3SRqVWQ7mN4PSE/Td0/Yokr/wsffsXfmMiF84PGqa5Cre3EPG2kyZZ/PJrZpFDwnYgA++jvD4UJJSLapxlHmUFsssL/1bNS/1SOJspcOFEaqNanzSUJIWKoen7pjYWiAGFtQchpVnaRL7cZLHq6TuDqlsURNvwI6/nEelqtngWxPMwEQePfp3STFrmBP+crN+I003wSi0Iax/5Gpaj3wy3dz8op+5lw1kJ58g9uWxFMC4LQWOmKVbs9v156dZqfwCkiy6V36qHs0eZJ1dTQsF1aaRhicyy8QIDoQknBASnkgyE2M+5gFiGDPETqSZkWshlYLQIDyVcGbjRJiDX0zWUq+XZ4wTWU2a6G5MUCJhmKwaZtBjmIQwISSuhhn2GCYnDAlMqmjKzsYIwlIiIQStshZ1tsYRoqIyhPXGcLiA2dbEVMXJVOUnigRmtiXi1e4E3psm2/3rLsmLcmI8MBXFr9vjppTphYT+/6cvL5ZRvvb5yvsCn4ZCC/W4i/3l82Q9gRMNEybrsu5dlflKvVhtwmPvPlcq3X8HQwa/lpz1a7Le20mDHbF7M27Y2/l2NAs1TVYLf1PfoLots7k6GkVyZPs1GRmuPV6/ZmYeiq2HUZ6Us4UqdeltTzRhm2iVaTe5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ywUQw9S0uFKr2mp44JJ2WFnVBkTpy7lq61l6L2JXUw2RP7NHOxpR2K2oD452ArvIWB+Y7hCZi6k751krVseQbU+HmzV3iFxI3bnk5s68AFmdLNcquklMg84xpQOWaIdvLX26FZZgtpSimTREZKVMU/SO0tAO691JGaL0jZQhF5qM7BOHQaKzD4Q7vpRIvr8kTNme/bMax7AnuKOS+9lttlpHDuObdgq1i9dWBI80OWGy7zW6cUMZEhnY7j6fUVE6CMm4DecdvM2tacUO8fvciiBujR9pD9BhJ9SAGQLrE2qG5JC0XYWfR1m0k1OE9fE82wjh4avcFtxQE/gWVlE1XXcdvjqtv3R5YQXwzIcumaVoZlrdgj7BwcP32tv/IsLx2BgSEDi0FjQR7YjS931qFDRlh3ypd3G7+cI+ERoSxttwYLUNh01aGOqkPSN2JIXeRHsOUMjpKe2ZmH1d9tBrC+35z+jJSG2m7tTmAtJtUJvfcY+mb8D6fxi1+eugNg9q86A2D2rzoDafe60MgvMgOP9ogjO+QDhhGkk+6M0XqTeftvWYZdO64FpTXE2+hVgoH4rNLEqhH47VjiF84s/u7I3paTmHgD6oYkf+lbW/tzOI5z/M91v3s6oWx55ZhRxkFcYds2o4CTCcBPi0JwH4cBLgY50EOHHQY9D/B/1/0P8H/X/Q/wf9f9D/B/1/0P8H/b9V/09SI/2fHbPjr/83t7EXxfr/V5u83opa7L38B0QctCE=
This is the main idea behind my blueprints:
First you build a filter circuit.
It gets "input" wire and "filter" wire, then it outputs all signals from input but only if the same signal is positive in "filter".
My implementation handles both positive and negative signals (from -1 billion up to 1 billion)
Filter circuit is done using this ideas:
1) Use condition combinator to get positive signals from "filter"
2) Multiply that by -2 billion (or any other big negative value)
3.1) Merge it with "input" on next combinator, so you effectively get input -2 billion * filter
3.2) Use condition combinator to get values above -1 billion
4) Now add back 2 billions
So it takes only 4 combinators to build (see numbers above, 3.1 and 3.2 is done on one decider combinator).
Also build "excluder" circuit
It's simmilar to "filter" but it excludes the second wire from the first one.
It can be build with 4 combinators (or less).
The ideas are same, so I won't describe it again, just here is the blueprint.
The blueprints are functional BUT I didn't even tryed to optimize them. I think if one wants to, than 3-4 combinators can be thrown away from them.
I'll appriciate if someone does that - please post updated versions.
Notes for thouse crazy guys who read this far and really wants to understand how it's done:
The idea behind max (min is roughly the same):
You have A and B wires and have to select max signals from them.
So basically
- First we make A<=B, this is essentially (B + 1) * (-1) + A < 0
- I.e. feed B into arithmetic +1, Arithmetic *-1, merge wires with A on next comb, decider <0 emit 1
- Now we have all "good" signals types from A, so just use "filter" circuit on A to get them
- Now we just exclude this "good" signals from B using "excluder
- And after that merge two parts
Done. You have good results
What won't work (the naive approach I tried at first but it didn't work):
- Using (A-B) <= 0 to filter A
and
- Using (A-B) > 0 to filter B
and then merge
Tried this. It won't work for equal signals.