19 lines
No EOL
430 B
JavaScript
Executable file
19 lines
No EOL
430 B
JavaScript
Executable file
// Functions
|
|
function scramble(word){
|
|
var tWord = word.split("");
|
|
var result = "";
|
|
|
|
while(tWord.length > 0){
|
|
let rInd = Math.floor(Math.random() * tWord.length);
|
|
result += tWord[rInd];
|
|
tWord.splice(rInd, 1);
|
|
}
|
|
|
|
return result;
|
|
}
|
|
function retrieveWords(wordList){
|
|
// Going through all index's
|
|
for(var i = 0; i < all_words.length; i++){
|
|
wordList.push(all_words[i]);
|
|
}
|
|
} |