Currently, the weightedPick function fails to mention precisely how much earlier items in the array are favored over later ones, which is a fairly important detail to simply omit without warning.
Admittedly, the provided code isn't the clearest in the world either...
weightedPick: function (array)
{
return array[~~(Math.pow(this.frac(), 2) * (array.length - 0.5) + 0.5)];
},
Currently, the
weightedPickfunction fails to mention precisely how much earlier items in the array are favored over later ones, which is a fairly important detail to simply omit without warning.Admittedly, the provided code isn't the clearest in the world either...