diff --git a/public/js/script.js b/public/js/script.js index 00fe3faf6..38d3df3ed 100644 --- a/public/js/script.js +++ b/public/js/script.js @@ -539,7 +539,9 @@ function initWords() { randomWord = punctuateWord(previousWord, randomWord, i, wordsBound); } if (config.numbers && config.mode != "custom") { - addNumber(wordsList); + if (Math.random() < 0.1) { + randomWord = Math.floor(Math.random() * 1000).toString(); + } } wordsList.push(randomWord); @@ -554,7 +556,7 @@ function initWords() { showWords(); } -function setToggleSettings(state){ +function setToggleSettings(state) { setPunctuation(state); setNumbers(state); } @@ -637,12 +639,6 @@ function emulateLayout(event) { return event; } -function addNumber(wordlist){ - if(Math.random() < 0.1){ - wordlist.push(Math.floor(Math.random() * 1000).toString()); - } -} - function punctuateWord(previousWord, currentWord, index, maxindex) { let word = currentWord; @@ -759,7 +755,9 @@ function addWord() { randomWord = punctuateWord(previousWord, randomWord, wordsList.length, 0); } if (config.numbers && config.mode != "custom") { - addNumber(wordsList); + if (Math.random() < 0.1) { + randomWord = Math.floor(Math.random() * 1000).toString(); + } } wordsList.push(randomWord);