Newsgroups: rec.arts.int-fiction
Path: news.duke.edu!newsgate.duke.edu!solaris.cc.vt.edu!news.vt.edu!news.netins.net!arclight.uoregon.edu!enews.sgi.com!coop.net!world!buzzard
From: buzzard@world.std.com (Sean T Barrett)
Subject: Re: [Inform] Random numbers...
Message-ID: <GC2Mnq.Jxq@world.std.com>
Date: Fri, 20 Apr 2001 03:21:26 GMT
References: <9b6vdn$qu5$1@news8.svr.pol.co.uk> <9bk5ks$isu$2@news.lth.se> <spiD6.3550$Uu6.337067@monger.newsread.com> <d6ef946d4a%kbracey@kbracey.cam.pace.co.uk>
Organization: The World Public Access UNIX, Brookline, MA
Lines: 22
Xref: news.duke.edu rec.arts.int-fiction:85863

Kevin Bracey  <kevin.bracey@pace.co.uk> wrote:
>Unfortunately, the ANSI C standard shows as an example a rather bad rand()
>algorithm. A decent C library implementation would avoid it like the plague.
>
>We use one from Knuth:
>
>---------------------------------------------------------------------------
>static unsigned _random_number_seed[55] =

[snip what i believe is a 'lagged fibonacci generator']

In fact, such lagged generators are so simple (no multiplies)
that it might well be plausible to implement it in the
library instead of the interpreter.  This would guarantee
portable pseudo-random number generation, although how to
get a random seed for "truely" random numbers is still
an open question, although keystroke timing is plausible
for those willing to have an initial timed keystroke or
ten. (Using a random number from the 'terp to seed it would
still be subject to the winfrotz restart bug...)

SeanB
