randomRange
@@ -36,6 +36,11 @@ Math.clamp = function(number, min, max)
36
36
return Math.min(max, Math.max(min, number));
37
37
}
38
38
39
Math.randomRange = function(min, max)
40
{
41
return min + (Math.random() * (max - min));
42
}
43
39
44
Array.prototype.random = function ()
40
45
{
41
46
return this[Math.floor((Math.random()*this.length))];
@@ -36,6 +36,11 @@ Math.clamp = function(number, min, max)36
return Math.min(max, Math.max(min, number));36
return Math.min(max, Math.max(min, number));37
}37
}38
38
39
Math.randomRange = function(min, max)40
{41
return min + (Math.random() * (max - min));42
}43
39
Array.prototype.random = function () 44
Array.prototype.random = function () 40
{45
{41
return this[Math.floor((Math.random()*this.length))];46
return this[Math.floor((Math.random()*this.length))];