Returns a random number from 0..weightings.length, distributed by the weighting values.
eg: produces 0 20% of the time, 1 50% of the time, 2 30% of the time
weightedIndex([0.2, 0.5, 0.3]); Copy
weightedIndex([0.2, 0.5, 0.3]);
Returns a random number from 0..weightings.length, distributed by the weighting values.
eg: produces 0 20% of the time, 1 50% of the time, 2 30% of the time