|
|
Anthony D. Baye <Sha### [at] spamnomorehotmailcom> wrote:
> I was getting hinky results when calling srand48(time(NULL)), but it turns out
> that the solution was to call it once at the beginning of the program, rather
> than every time I called my Random() function...
Well, think about it a bit. time() returns the amount of seconds since
some starting time. You are using that value to tell the random number
generator "start from here".
If you do it again in less than a second, you will be again telling the
random number generator "start from here" (ie. the exact same number). What
do you expect to happen?
--
- Warp
Post a reply to this message
|
|