7

i do have 6 inputs. 3 A inputs, 3 B inputs. Each one of them can be set to on or off. I now have to compare those 6 and look who has more on-inputs. A or B?

Does anyone have a solution for this?

What i've tried so far:

  • For each A and B, make a dropper counter, that stores up to 3 items. Everytime one A input gets on, it puts one item in the "on" Dropper, whereas when one A-input goes off, it takes it again. After that i have 2 Droppercounters to compare with Comparators. Problem: Goes far to big for my survival map. Don't like that solution.

  • I thought of something like this - haven't tried it actually. Make a 15 signal strength input and feed it to a comparator set to subtraction mode. Now feed all the 3 A inputs into this main line and subtract their power. We get an output ranging from 12 to 15 (12 meaning A has 3 inputs on, 15 meaning A has 0 inputs on).

  • Looked up all the logic gates. There might be one for comparing 6 inputs etc. Haven't found one.

I am trying to make the redstone simple and small!

10
  • 1
    Ooh, this does look fun. Commented Apr 17, 2014 at 11:42
  • 1
    If you are interested in a logic-circuit solution you can write a truth table (six inputs, one function value) which you could you use to derive a logic formula which only uses the logic operators you would like to use. Use can combine logic gates with two inputs to make a more complex logic circuit. Commented Apr 17, 2014 at 11:54
  • @ Viktor Seifert: The problem is that all the minecraft logic gates i see have 2 outputs. On and off. I need 3. 1: A has more inputs on than b, 2: B has more inputs on than A, 3: Both has the same number of inputs on. Therefore i can't really combine the normal logic gates... So in general: i have 6 inputs and 3 outputs.
    – Shiuyin
    Commented Apr 17, 2014 at 11:57
  • @ Viktor Seifert: That would be helpful. It took me 30minutes today to build my Droppercounter solution in creative, as mentioned above. And i don't really like that solution. There has to be a better way!
    – Shiuyin
    Commented Apr 17, 2014 at 12:03
  • Using the truth table approach is impractical at best. There are 2^6 = 64 different input combinations. One important question I have is what if both A and B have the same number of inputs on? What if they're all off?
    – MBraedley
    Commented Apr 17, 2014 at 13:12

2 Answers 2

6

I'm not sure why you didn't do your second idea, but it is actually pretty straight-forward:

enter image description here

Torches are the six inputs; lamps are output: ON-OFF = tie; ON-ON = bottom wins; OFF-OFF = top wins

1
  • Thanks a lot! I know tons of stuff about all redstone stuff except comparators. Haven't really worked with them yet. Thank's a lot for that, i guess i wouldn't have figured that out alone.
    – Shiuyin
    Commented Apr 17, 2014 at 20:16
0

Really, you're trying to compare two inputs, simply each of those inputs has more than just true or false, it has 0, 1, 2, and 3. Basically, instead of comparing two booleans in programming, you're comparing two integers. It would almost certainly be best to break it down side by side, and then at the end, compare each of those sides, rather than trying to compare all 6 inputs at once.

This likely isn't the best solution, as unfortunately I haven't personally used comparators in minecraft yet, but from what I do know, this should work. You can use a dropper for each side, A and B, that stores a large number of items, when doing the actual comparison, you can then activate the dropper for each side based on the number of 'ons'. These droppers will dispense items onto a gold weighted pressure plate on each side, whose signals will each be put into a comparator. That comparator will then be doing the actual comparison between each side, and the comparator will either output a signal or not based on the signal strength of each side.

2
  • This basically is what i wrote in my first point at "What i've tried so far". And i don't like that solution. There has to be a better one. I know that it is working, i built in in singleplayer creative mode. But i personally think its to big for that little feature ...
    – Shiuyin
    Commented Apr 17, 2014 at 14:45
  • Really? It should be a pretty concise structure. The only way to do it not using a variable strength output such as a chest, hopper, furnace, or weighted pressure plate that I can see would be to do an xor on all possible combos, which would take up a large amount more space.
    – Waterseas
    Commented Apr 17, 2014 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.