Answer the question
In order to leave comments, you need to log in
What does the random number algorithm look like in roulettes?
Hello.
I want to make it clear right away, I'm not trying to beat someone else's roulette, on the contrary, I'm making my own likeness.
Important: In my roulette, you can only bet on color. That is, only on black, green or red. This is a simplified version of the regular roulette that omits many other user features such as betting on a number, angle, and so on. Only colors.
I wrote on the basis of an ordinary Math.random () on the server side which is written in Node.js. The disadvantages of this method are obvious. She is predictable. I tried to google those modifications that introduce other roulettes into their random number generation algorithm, but everywhere I find only daredevils who tried to beat a specific roulette.
Thanks in advance for your support.
Answer the question
In order to leave comments, you need to log in
"Math.random() .... The disadvantages of this method are obvious. It is predictable."
are you a clairvoyant?
Player error
I directly had a hand in the development of roulette, there is nothing supernatural in the generation of random numbers. Classic:
function rand(min, max){
return Math.floor(Math.random() * (max - min + 1)) + min;
}
Well, if your randomness is predictable (maybe you initialize it with a constant?), take some cryptographic randomness.
Everything you say is right.
Mix in dynamic external parameters that are not available to the client: process id, used/free memory, free space, and the like.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question