Random System (randSystem)

Estimated reading time: less than 1 minute

The randSystem provides various random number generation utilities including weighted random, range random, and more.

Access via maplebirch.tool.rand or shortcut maplebirchFrameworks.rand().

Usage

const rand = maplebirch.tool.rand;

Core Methods

Method / PropertyDescription
create()Create a new RNG instance
SeedGet or set seed for reproducibility
get(max)Random integer 0 to max (inclusive)
rngRandom integer 1–100 (percentile)
backtrack(n)Roll back n random values
historyHistory of generated values
pointerCurrent position in history

Example

const rng = maplebirch.tool.rand.create();
rng.Seed = 42;

const num1 = rng.get(10); // 0–10
const num2 = rng.rng; // 1–100