lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 3/19/07, Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br> wrote:
> The Lua Wiki Math Library Tutorial page[1] says:
> "But beware! The first random number you get is not really 'randomized'
> (at least in Windows 2K and OS X)."

That's the way Pseudorandom number generators usually work. See
        http://en.wikipedia.org/wiki/Pseudo-random_number_generator

To fix that, start your program with
        math.randomseed(os.time())
for instance.
--lhf
I think the issue he's seeing is that even w/ diff seeds, the first
val is still 66.
--
Thomas Harning Jr.