This repository has been archived on 2026-04-25. You can view files and clone it, but cannot push or open issues or pull requests.
WordGame-JS/Base/scripts/systems.js

19 lines
430 B
JavaScript
Raw Permalink Normal View History

2024-05-08 12:41:16 -05:00
// 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]);
}
}