lua-users home
lua-l archive

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

>    The trouble is, when using Lua as a stand-alone, there's no good way to
> "randomly" seed the RNG -- date() returns a string,

If you call "date" with appropriate arguments, it returns a string in
numeric format, which is then converted to a number when used as argument
to randomseed. For instance, if you call


your seed is a concatenation of the current hour-minutes-seconds (pretty
close to "real" time for random purposes).

-- Roberto