Get random number between min and max
//Returns a random number between min (inclusive) and max (exclusive)
function getRandom(min:Number, max:Number):Number {
return Math.random() * (max - min) + min;
}
//Returns a random integer between min (inclusive) and max (inclusive)
function getRandomInt(min, max):int {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
Comments
0 B
|👍
/👎
0 B
|0 👍
/0 👎
0 B
|👍
/👎
0 B
|👍
/👎