Created
February 6, 2013 10:06
-
-
Save FrancescoMaisto/4721586 to your computer and use it in GitHub Desktop.
Returns a random integer within the specified range (included)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package utils | |
{ | |
/** Returns a random integer within the specified range (included) */ | |
public function getRandomNumber(min:Number, max:Number):int | |
{ | |
return Math.floor(Math.random() * (max + 1 - min)) + min; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment