mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-04 04:51:16 +08:00
made sure new words dont include spaces
This commit is contained in:
parent
bbb82684c6
commit
5f6acaa600
1 changed files with 3 additions and 0 deletions
|
@ -163,6 +163,9 @@ function buildSentences() {
|
|||
function addWord() {
|
||||
let language = words[config.language]
|
||||
let randomWord = language[Math.floor(Math.random() * language.length)];
|
||||
while (randomWord.indexOf(' ') > -1) {
|
||||
randomWord = language[Math.floor(Math.random() * language.length)];
|
||||
}
|
||||
wordsList.push(randomWord);
|
||||
let w = "<div class='word'>";
|
||||
for (let c = 0; c < randomWord.length; c++) {
|
||||
|
|
Loading…
Reference in a new issue