mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-02 12:00:10 +08:00
replacing words with numbers instead of adding extra numbers
This commit is contained in:
parent
e0bbff3a0f
commit
d5eb52481d
1 changed files with 7 additions and 9 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue