API Reference › Random
namespace

Random

A seeded, deterministic RNG — same seed, same sequence, every run and every platform.

Random.range(low, high) -> intA random integer in the inclusive range [low, high].Random.chance(percent) -> boolReturn true with the given percent probability.Random.seed(value)Seed the random generator so runs are reproducible.Random.value() -> fixedA random fixed value in [0, 1).Random.int(max) -> intA random integer in [0, max).Random.sign() -> intA random +1 or -1.Random.weighted(weights: []int) -> intAn index drawn in proportion to its weight.
← All symbols