Generates deterministic pseudo-random numbers using the mulberry32 technique. Uses 0 (inclusive)...1 (exclusive) scale like ``ath.random()`.
By default it uses a fixed seed, so each time it's used it always produces the same sequence of random values.
// Get the functionconst r = mulberrySource();// Generate a numberr(); // 0..1 Copy
// Get the functionconst r = mulberrySource();// Generate a numberr(); // 0..1
To create a more properly random source, use the time as the seed:
const r = mulberrySource(Date.now()); Copy
const r = mulberrySource(Date.now());
Generates deterministic pseudo-random numbers using the mulberry32 technique. Uses 0 (inclusive)...1 (exclusive) scale like ``ath.random()`.
By default it uses a fixed seed, so each time it's used it always produces the same sequence of random values.
To create a more properly random source, use the time as the seed: