|
|
clipka <ano### [at] anonymousorg> wrote:
> Am 26.08.2010 00:52, schrieb Anthony D. Baye:
>
> > The chief problem is thatsuccessive calls to the program return the same result
> > every time.
> >
> > The only way I've found to change the result is to modify the initial conditions
> > (i.e. changing the number of seed values in the grid before calling the
> > Diamond_Square() function.)
>
> Why, yes - of course; that's how pseudo-random number generators work
> ;-). they're deterministic, after all (and as often as not this is even
> desired). To get a different result each time, a typical solution
> (outside of cryptographic applications that is) would be to seed with
> the current system time instead of a constant.
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...
makes sense, I guess...
Thanks for all the help...
Post a reply to this message
|
|