Use a 3-clock with redundancy (otherwise it'll burn out), a mechanism to capture the pulse stage it's on when the button is pressed, lengthen the pulse, and send it to the correct door? Best thing I can think of.
It would certainly involve a 3-clock, (which I'm pretty sure doesn't exist,) but you'd just set each door to be opened by a different AND gate. each AND gate would have your button as one of the inputs and one of the three outputs of the 3-clock as the other.
what i really wanted to do was to generate a random number, push a button of which number you think it is (1, 2 or 3) then it says if it's right or wrong (by lighting up a O or a X)
what i really wanted to do was to generate a random number, push a button of which number you think it is (1, 2 or 3) then it says if it's right or wrong (by lighting up a O or a X)
is it evne possible? o_O
Randomness is a tricky concept in computer programming, and redstone wiring is a basic form of logical programming. Everything you do is deterministic, in that it is determined by the construction and the inputs.
What you need to do is find a source of randomness and then harvest it.
The three clock idea is probably your best way to capture the random time of selection. You make a loop of redstone repeaters on a delay, and then each third corresponds to a different door. That way the time of the press determines the number, and if you hide the circuit it will seem random to the player.
Another source of randomness is the player's thrown item. You could set up a water flow to three pressure plates and see that a drifting item hits a 'random' pressure plate. It will probably pick one of the doors the majority of the time, however.
I think your best source of randomness is monsters and creatures' walking. Put some switches in a pig pen and see them get stomped on 'randomly'. The pig's walking path is determined by Java's random number generator, which uses the JVM start time and is as good as you can get on a PC.
In each case, you will need an AND gate between the decision and the button.
How about using random cactus logic? Basically setup a cactus where each time it grows the top pops off and lands on a wooden pressure plate. Make a system that stores the last plate to give input. This will determine the door that opens.
Perhaps hook up 3 of these to provide new inputs more frequently.
How about using random cactus logic? Basically setup a cactus where each time it grows the top pops off and lands on a wooden pressure plate. Make a system that stores the last plate to give input. This will determine the door that opens.
Great idea, simpler than the water or pig things I had come up with and still captures randomness.
The drawback being that it is slow. Decisions do not change, and over time many buttons will be held down. So you do need a reset and memory cell if you want to simply see which was the most recent button pressed. Unless there's a way to reset the device with a water-flow. Still, I can't think of a way for the once-pressed button to ever become un-pressed. Items do not de-spawn fast enough.
This design seems simple enough and fairly compact. I'm not real good with redstone but it seems to me you could hook three outputs from something like this and store a value between 1-3 based on which of the 3 outputs came active. The last stored value would determine which door was activated when the button is pushed. It would certainly be fast and I don't see an easily discernible pattern to the burnouts so should be fairly random. I'm not sure how the torch burnouts might effect things though.
The cactus thing would work great for pistons! You push a button- activates piston- knocks the top of cactus off-gets thrown a random direction-lands on random pressure plate!
The best random number generator I've ever seen in minecraft worked by having the button's output cycle between the 3 possible outputs using a clock. The randomization factor comes from when the button is pushed. Because you can never tell which of the 3 outputs the button is currently linked to, the output is essentially random because it is based on human choice (your choice of when to activate the button) with no logical decision behind said choice (you don't know when each door is linked, and so you can't choose when to press the button). It's kind of Schrodinger-esque.
How can I do this?
I tried using repeaters but it doesn't stop after I click the buttons.
I'm not asking for the full solution, just a few hints maybe? Ty :smile.gif:
Same answer. =)
It's actually a part of a bigger system, and I still have this part to do.
I also wonder if it would be very complex to do? Yes a question mark at the end of a sentence.
what i really wanted to do was to generate a random number, push a button of which number you think it is (1, 2 or 3) then it says if it's right or wrong (by lighting up a O or a X)
is it evne possible? o_O
Randomness is a tricky concept in computer programming, and redstone wiring is a basic form of logical programming. Everything you do is deterministic, in that it is determined by the construction and the inputs.
What you need to do is find a source of randomness and then harvest it.
The three clock idea is probably your best way to capture the random time of selection. You make a loop of redstone repeaters on a delay, and then each third corresponds to a different door. That way the time of the press determines the number, and if you hide the circuit it will seem random to the player.
Another source of randomness is the player's thrown item. You could set up a water flow to three pressure plates and see that a drifting item hits a 'random' pressure plate. It will probably pick one of the doors the majority of the time, however.
I think your best source of randomness is monsters and creatures' walking. Put some switches in a pig pen and see them get stomped on 'randomly'. The pig's walking path is determined by Java's random number generator, which uses the JVM start time and is as good as you can get on a PC.
In each case, you will need an AND gate between the decision and the button.
Perhaps hook up 3 of these to provide new inputs more frequently.
by c0yote
I tried it with terrible results. I gave my wife my glasses for a second, a creeper showed up and now my wife is pregnant.
Stupid 3D..
Great idea, simpler than the water or pig things I had come up with and still captures randomness.
The drawback being that it is slow. Decisions do not change, and over time many buttons will be held down. So you do need a reset and memory cell if you want to simply see which was the most recent button pressed. Unless there's a way to reset the device with a water-flow. Still, I can't think of a way for the once-pressed button to ever become un-pressed. Items do not de-spawn fast enough.
http://www.minecraftforum.net/topic/80719-new-very-compact-redstone-clockrandom-generator/
This design seems simple enough and fairly compact. I'm not real good with redstone but it seems to me you could hook three outputs from something like this and store a value between 1-3 based on which of the 3 outputs came active. The last stored value would determine which door was activated when the button is pushed. It would certainly be fast and I don't see an easily discernible pattern to the burnouts so should be fairly random. I'm not sure how the torch burnouts might effect things though.
by c0yote
I tried it with terrible results. I gave my wife my glasses for a second, a creeper showed up and now my wife is pregnant.
Stupid 3D..
take the output of them at one instant
And(Gate)together possible results
Examples:
Door- 1 and 0
Door- 1 and 1
Door- 0 and 0