Random library¶
Note
This library will be included (and installed) with Keel in the 0.3.0 release that's coming soon.
Warning
This is highly subject to change.
Import this library with import "std/random.kl"; at the top-level.
Random¶
random::random() -> float
Returns a random float within [0;1[.
RandomRange¶
random::random_range(min: float, max: float) -> float
Returns a random float within the given extrema.
RandomInt¶
random::random_int() -> int
Returns a random int.
RandomIntRange¶
random::random_int_range(min: int, max: int) -> int
Returns a random int within the given extrema.
Seed¶
random::seed(seed: int)
Seeds the RNG with seed.