lua-users home
lua-l archive

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


On 2002/11/14 12:16:36, "Bram Vaessen" <bram.vaessen@wxs.nl> wrote:

> There is no info about the randomseed function in the library. How do I
> randomize the random function??
> (like srand(time()) )

to the simple random generator functions rand and srand, provided by ANSI 
C."

Now, we don't have a time() function...

Perhaps try:

dostring("timev = " .. date('%Y') .. date('%j') ..
  date('%H') .. date('%M') .. date('%S'))
randomseed(timev)

or other combinations of these values.

There may be a simpler method...

-- 
--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--=#=--
Philippe Lhoste (Paris -- France)
Professional programmer and amateur artist
http://jove.prohosting.com/~philho/