I think you have missed the point - there is no infinite loop just a problem with the random number returned sometimes being outside the specified boundary. Thanks anyway.
Thanks - however if you read the Random class to be safe one is recommended to override at least 2 methods which seems like overkill for a simple program such as I'm writing. Any idea why using the Rnd() function doesn't work - it is quoted in the MSDN and all over the web. Is there something I...
I am using the following code in the Load method of a VB form to generate random numbers in the range 1 to 8. Without fail after enough loops the range is exceeded and 9 is the random number returned every time. The line using the Rnd function is from:
Rnd Function (Visual Basic)...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.