Name
seed — Set the seed value for the random number generator
Usage
Lang.seed(seed)
: Numberseed
Description
Seeds the random number generator used by Lang.random( )
. If seed
is less than zero,
uses a random internal value (typically, the system time). Otherwise,
uses seed
to seed the generator. If
seed
is a floating-point value,
Float.int( )
first converts it to an integer.
Returns the empty string; but if seed
can’t be converted to a number, returns
invalid
.
Examples
Lang.seed(23)
seeds with integer 23
and returns
""
Lang.seed(1.2)
seeds with integer 1
and returns
""
Lang.seed("foo")
returns invalid
and doesn’t change the
seed.
Get Learning WML, and WMLScript now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.