herky1978
Computer
- Apr 20, 2005
- 1
Does anyone know of a C random function that allows for weighted variables? For example...
I would like to assign variable a random value between 1 and 5. However, I would like for this value to be certain numbers more frequently than others. So I would like to be able to use a function that will randomly select the value 1 - 20% of the time, 2 - 25% of the time, 3 - 30% of the time, and so on.
I would like to assign variable a random value between 1 and 5. However, I would like for this value to be certain numbers more frequently than others. So I would like to be able to use a function that will randomly select the value 1 - 20% of the time, 2 - 25% of the time, 3 - 30% of the time, and so on.