提供各类随机数生成工具,包含加权随机、范围随机等功能。
请使用 maplebirch.tool.rand。
maplebirch.tool.rand
const rand = maplebirch.tool.rand;
create()
Seed
get(max)
rng
backtrack(n)
history
pointer
const rng = maplebirch.tool.rand.create(); rng.Seed = 42; const num1 = rng.get(10); // 0–10 const num2 = rng.rng; // 1–100