dimanche 20 novembre 2016

Random number that prefers a range

I'm trying to write a program that requires me to generator a random number.

I also need to make it so there's a variable chance to pick a set range.

In this case, I would be generating between 1-10 and the range with the percent chance is 7-10.

How would I do this? Could I be supplied with a formula or something like that?




Aucun commentaire:

Enregistrer un commentaire