Last active
October 8, 2015 14:07
-
-
Save webercoder/3342614 to your computer and use it in GitHub Desktop.
Order and Chaos Giveaway Picker
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
| function getRandom(min, max) { | |
| var randomNum = Math.random(); | |
| console.log(min + ', ' + max + ', ' + randomNum); | |
| return min + Math.floor(Math.random() * (max - min + 1)); | |
| } | |
| function getPlayer() { | |
| var shadowRiders = ['user', 'list', 'here']; | |
| var min = 1; | |
| var max = shadowRiders.length; | |
| var index = getRandom(min, max); | |
| return shadowRiders[index - 1]; | |
| } | |
| console.log(getPlayer()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment