Random integer, weighted according to an easing function. Number will be inclusive of min and below max.
min
max
import * as Random from 'https://unpkg.com/ixfx/dist/random.js';const r = Random.weightedIntegerFn(100);r(); // Produce value Copy
import * as Random from 'https://unpkg.com/ixfx/dist/random.js';const r = Random.weightedIntegerFn(100);r(); // Produce value
const r = Random.weightedIntegerFn({ min: 20, max: 30 });r(); // Produce value Copy
const r = Random.weightedIntegerFn({ min: 20, max: 30 });r(); // Produce value
const r = Random.weightedInteger({ max: 100, easing: `quadIn` }); Copy
const r = Random.weightedInteger({ max: 100, easing: `quadIn` });
Note: result from easing function will be clamped to the min/max (by default 0-1);
Maximum (exclusive)
Function that produces a random weighted integer
Random integer, weighted according to an easing function. Number will be inclusive of
min
and belowmax
.Example: 0..99
Example: 20..29
Example: 0..99 with 'quadIn' easing
Note: result from easing function will be clamped to the min/max (by default 0-1);