Minecraft – How to randomise the output of a redstone circuit

minecraft-java-editionminecraft-redstone

I have 5 buttons and only one of these can be correct, all others must be false.

These 5 outputs will go into 2 outputs, in between there needs to be a circuit which changes which single button out of the 5 will go down the "correct" output of the final 2. The 4 remaining buttons must go to the second of the final 2 outputs.

Both final outputs must give out a true signal for a brief period the same as a button on its own would produce.

There should also be a way of activating the circuit.

Not sure if that is explained well enough so I have made a basic diagram of what I need.

Diagram of redstone circuit

The diagram shows how I need the signal to be split. However in between the buttons and the final two wires there needs to be a circuit (marked by the grey box). This circuit changes the single button connected to the left wire. The right input should start the circuit and randomise the 5 buttons.

There are no limits to size, amount of materials used or method used.

This question is similar to the one asking about random numbers in Minecraft commands, but I am specifically working with Redstone circuitry – the commands solutions do not apply here

Best Answer

Since there is no answer I will show how to make a random unit:

If you are not ready to have your mind blown go to conclusion at the end.

Take a 3-clock unit and set an output somewhere, now since this is only 3-clock it's gonna burn at RANDOM place so the output will be random. Like this: enter image description here

Now you probably don't want it to change so much but only when it stopped, well.. idk if anyone used it(probably used), anyway I've made it my self, I call it "signal cuter" the point is to split the signal into 2 signals: first contain odd number of "not gates" and the second even, and then merge them into "or gate", the result is: when a signal is sent, it's gonna stay as the output until the second path will cut the signal and that way no matter for how long you set the input to "on", the output gonna be "on" only for length(second path) - length(first path) "ticks".

enter image description here

in this example, all signals that are more then 3 ticks length are shorted to 3 ticks long. On same property you can make a "signal protector" also made by me :), it's not passing signals less than X long all the difference is that both paths first and second need to be odd length and the X is equal to length(second path) - length(first path), but the signal become shorter then the original signal length. Example:

enter image description here

FINALLY the conclusion: so now you can take the a 3-clock and to chain it with the "signal protector" with X=2 and THIS WILL BE STABLE!! It won't throw junk until the 3-clock burned and the result is stable, the next random will be generated after the next 3-clock burn, if you want to make it faster just make many units of that.

THE RESULT:

enter image description here

It's still throw junk in "Redstone Simulator" but in "Minecraft" this works great! Please if you're passing on this technique, leave the names "Signal Cutter" and "Signal Protector".