Answer the question
In order to leave comments, you need to log in
How to make the chances of winning?
Hi all! How to make chances for Random, I need to be able to adjust the odds, let's say that the number 1 gives more often than the number 2
Answer the question
In order to leave comments, you need to log in
There is such a thing - weight random.
Each item has a weight. When generating - the weights are summed up, a number is generated from 0 to the sum, and then we sequentially go through all the items, summing their weights, until the sum becomes more than the generated random number. On what item it happened - he fell out. The description is a little clumsy, but you can google "weight random".
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question