try this:
Create a System.Random type that generates a value between 1 and 12. ( I
chose 1 - 12 so that the value '8' has the same distance to the "upper bound"
as '5' does to the "lower bound")
Subtract the random value from 5, then from 8. Which ever operation
produces the smallest absolute value, then use the value (5 or 8)that
produced this result. For instance, if the random value is 6, then then the
results will be -1, and 2. (5 - 6) results in the smallest absolute value,
therefore 5 would be selected based on this logic.
"Paul Tomlinson" wrote:
How can I randomly pick either the value integer 5 or integer 8??
I don't want a value between 5 and 8 but either the values 5 or 8 randomly.
Any ideas on how can I do this please??
MA