Created
December 29, 2014 07:14
-
-
Save Ryanb58/860731db2a9ffdf4896c to your computer and use it in GitHub Desktop.
Simple script that records it's history so as not to repeat itself two times in a row...
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
var gameMaster = "Ryanb58"; | |
var listOfPlayers = ['Taylor','Ryanb58','Jack','John','Kyle']; | |
var playerNumber; | |
for(i=0; i<25; i++) | |
{ | |
//console.log("Current GM: " + gameMaster); | |
playerNumber = listOfPlayers.indexOf(gameMaster); | |
while(gameMaster == listOfPlayers[playerNumber]) | |
{ | |
//max(exclusive) min(inclusive) --> Math.floor(Math.random() * (max - min) + min); | |
playerNumber = Math.floor(Math.random() * listOfPlayers.length); | |
} | |
gameMaster = listOfPlayers[playerNumber]; | |
console.log(i + ") " + listOfPlayers[playerNumber]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment