-
-
Save illuzor/fdce7effbbb00fba3cd90ec51b5d5c20 to your computer and use it in GitHub Desktop.
randomInt.as
This file contains 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 { | |
/** | |
* | |
* Генератор (псевдо)случайного целого числа в заданном диапазоне. | |
* | |
* @param minNum Минимальное значение. | |
* @param maxNum Максимальное значение. | |
* @return Сгенерированное число | |
*/ | |
public function randomInt(minNum:Number, maxNum:Number):Number { | |
return (Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment