Skip to content

Instantly share code, notes, and snippets.

@FrancescoMaisto
Created February 6, 2013 10:06
Show Gist options
  • Save FrancescoMaisto/4721586 to your computer and use it in GitHub Desktop.
Save FrancescoMaisto/4721586 to your computer and use it in GitHub Desktop.
Returns a random integer within the specified range (included)
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