13.07.2011, 06:00
Quote:
1. store the numbers in an array.
new rand[] = {3, 7, 25, 66, 9};
2. count the numbers in the array.
new size = sizeof(rand);
3. generate random number from the total numbers in the array.
new randn = random(size);
4. select the random number from the array index.
new random_value = rand[randn];
How hard is that?