[DGD] Random Number Generation

Stephen Schmidt schmidsj at union.edu
Tue Apr 25 21:17:02 CEST 2006


On Tue, 25 Apr 2006, Shentino wrote:
> Is it possible to control the stream of random numbers that are spit
> out by the random(int) kfun?
> IMHO it would be quite nice if the RNG algorithm were cross platform
> identical and if you could seed the RNG to exactly duplicate any
> sequence of random numbers.

It'd probably be easier to simply code your own random number
generating algorithm and allow it to pass the seed. Simple
random number algorithms are not complex and readily available.
The kfun probably produces "better" random numbers by using a
better algorithm than a simple one (although maybe not; I'm
guessing random() gets a random from the system?) but the
random algorithm you'd write yourself would be good enough
for the purpose, I'm sure. And it'd be much easier to do
that than start hacking kfuns, I bet.

Steve





More information about the DGD mailing list