Last active
December 14, 2015 17:59
-
-
Save Glench/5126225 to your computer and use it in GitHub Desktop.
calculate percentage chance, returning true or false. basically equivalent to spinning a roulette wheel and telling you if you won on that round or not.
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
var percentChance = function(integerPercent) { | |
return Math.random()*100 < integerPercent; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment