Reply
Wed 16 May, 2007 06:28 am
I need to generate a random integer number between 3 and 79 with equal probability. I know how to get such a number between (inclusive) 1 and 79, but I cant generate the numbers so that they will always be greater than 3. I can do this with a if loop, but this is laborious, and when the number is less that 3 it is set to 0. Any help?
If you can generate 1-79 then you can probably generate 1-77.
Simply generate a random number between 1 and 77 and add 2 to it.
Genius! Oh my goodness, that is fantastic! Thank you so very much parados! (I feel silly for not noticing that...) I may have more questions, so keep checking back here regularly, please! I could use your brilliant logic...