L
L
LemanRass092017-01-26 00:08:38
Algorithms
LemanRass09, 2017-01-26 00:08:38

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

5 answer(s)
Y
Yuri, 2017-01-26
@riky

"Math.random() .... The disadvantages of this method are obvious. It is predictable."
are you a clairvoyant?
Player error

N
Nwton, 2017-01-26
@Nwton

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;
}

1
15432, 2017-01-26
@15432

Well, if your randomness is predictable (maybe you initialize it with a constant?), take some cryptographic randomness.

X
xmoonlight, 2017-01-26
@xmoonlight

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.

X
x67, 2017-01-26
@x67

if 1==1 then
     UserLoseTheGame( );
else
     UserWin( );
end if

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question