Created
April 4, 2015 22:18
-
-
Save michalbe/a6a5bdbd20557d26ae32 to your computer and use it in GitHub Desktop.
Losowanie druzyn
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 people = [ | |
"budzor", | |
"wojteck", | |
"aga", | |
"wasiak", | |
"luiza", | |
"luki", | |
"oktan one", | |
"paula", | |
"dżaga" | |
]; | |
var teams = 3; | |
var nrOfPeople = 3; | |
while(teams--) { | |
document.body.innerHTML += "<br/>TEAM " + (3-teams); | |
people.sort(function(a, b){ | |
return Math.random() * 1 - 0.5; | |
}); | |
for (var i =0; i<nrOfPeople; i++) { | |
document.body.innerHTML += "<br/>" + people.pop(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment