Skip to content

Instantly share code, notes, and snippets.

@pedrofracassi
Created October 20, 2018 17:55
Show Gist options
  • Save pedrofracassi/9eae42d3c3a9785ea6340f304cf00c08 to your computer and use it in GitHub Desktop.
Save pedrofracassi/9eae42d3c3a9785ea6340f304cf00c08 to your computer and use it in GitHub Desktop.

Vou escrever isso aqui depois

var palavras = [
['but', 'won\'t'],
['he'],
['definitely', 'definitly', 'definetely', 'deathly', 'defiantly', 'deftly'],
['negotiated'],
['this', 'his'],
['way'],
['past the', 'pass the', 'passing the'],
['harbour', 'harbor', 'harbouring', 'harboring'],
['enclosure', 'in closure', 'closure']
];
var usadas = [];
var frase = "";
function randomFromArray(array) {
return array[Math.floor(Math.random()*array.length)];
}
while (0 != 1) {
var frase = "";
palavras.forEach(function(entry) {
frase = frase + " " + randomFromArray(entry);
});
if (frase.toString().length - 1 == 59) {
if (!usadas.includes(frase)) {
usadas.push(frase);
console.log(frase);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment