WordGame-JS/Base/scripts/systems.js
2024-05-08 13:41:16 -04:00

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]);
}
}