Last active
August 2, 2016 16:17
-
-
Save nporteschaikin/eaa5176caa2d564acd5c2dbe900b50c9 to your computer and use it in GitHub Desktop.
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 shuffle(array) { | |
for (var i=array.length-1; i>0; i--) { | |
var j = Math.floor(Math.random() * (i + 1)); | |
var temp = array[i]; | |
array[i] = array[j]; | |
array[j] = temp; | |
} | |
return array; | |
} | |
function draftOrder(players) { | |
var result; | |
for (var i=0; i<13; i++) { | |
result = shuffle(players); | |
} | |
return result; | |
} | |
draftOrder(['NPC', 'JB', 'CT', 'Spector', 'Wex', 'Jesse', 'Kraz', 'Pri', 'Morrie', 'Macho', 'Tron', 'Pat']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment