Skip to content

Random library

Warning

This is highly subject to change.

Import this library with import std::random; 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.