-
-
Save malkafly/35bd6e59c3db7cde7605 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
/* | |
* True Match Team (original 2) | |
* | |
* If you are unfamiliar with js, try visit: | |
* http://www.malkafly.com.br | |
* adaptado da versão de R. Alviani: https://gist.github.com/rodrigoalviani/977351b31da2c14b9b72 | |
*/ | |
'use strict'; | |
var i = 0; | |
var names = ['J. Debug', 'Tom roludo', 'Malvim Sub Linguagem','Capitão Caverna','Caverninha', 'Denise','Robsola Jabor','Brunovisk','Argentino','Danilo da Guitarra','Mauricio perneta','Lana.','Fritz','Riberim']; // add names here | |
var len = (names.length / 2); | |
function matchTeam () { | |
return 'Time #'+ (i+1) + ' ' + selectName() + ' & ' + selectName(); | |
} | |
function selectName () { | |
var name = names[Math.floor((Math.random() * names.length))]; | |
if (name === undefined) { | |
return '__________'; | |
} else { | |
names.splice(names.indexOf(name), 1); | |
return name; | |
} | |
} | |
for (i = 0; i < len; i++){ | |
console.log(matchTeam()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment