Mail Archives: djgpp/1996/11/21/08:44:38
Eli Zaretskii wrote:
>
> This is a feature. All random functions return serias which can be
> repeated exactly on the next run. Otherwise, people who run simulations
> could not debug their programs and compare the results from different
> runs.
Other uses of this:
in games :
suppose you generate a maze, use of rand() with the same seed enable you
to generate twice the same maze, while keeping it random-like (in
"dungeon" games, this is useful : you can save one maze as just a number,
and hence save a lot of storage...)
in some picture generation programs, like raytracers :
some functions such as those which generate clouds, bumps... use a random
number generator. Using random series with the same seed enable to get
the same image when you calculate it twice...
- Raw text -