提供各类随机数生成工具,包含加权随机、范围随机等功能。
可通过 maplebirch.tool.rand 或快捷接口 maplebirchFrameworks.rand() 访问。
maplebirch.tool.rand
maplebirchFrameworks.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