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 turn = 0; | |
var teams = ['Rupie', 'TheTeam', 'Veritas', 'ImaginApp', 'Nebuchadnezzar', 'InternalServerError']; | |
var patoTeams = ['YisusPlusOne', 'ZipCity2000', 'tqzptscsaj']; | |
var pedroTeams = ['String.random','ToPa']; | |
var thomasTeams = ['LosExtraterrestresMusicales', 'Rock and Prog', 'PW:Software']; | |
var result = teams.sort(function(){return 0.5 - Math.random();}) | |
.reduce(function(previous, current) { | |
previous[['pato', 'thomas', 'pedro'][turn++ % 3]].push(current); | |
return previous; |