RE: [AD] srand() |
[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]
> Is rand() combined with srand() so unportable that allegro needs it's
> own version? If it is, why does Peter not want it? I do think a random
> number generator is a vital part of games programming so it would
> belong in allegro, but I myself have never had problems using the libc
> random generator. I would therefore support Peter that we
> don't need it.
The important point is that the standard doesn't mandate the
particular implentation of it, so you can't rely on a single
seed to yield the same stream of numbers in different libcs.
Which rules out nifty things you can do, eg to generate the
same level on two different machines playing together just by
transmittming the seed, having replay capability just by
storing the seed and player/network input, etc).
--
Vincent Penquerc'h
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |