mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-01 19:17:00 +08:00
Merge branch 'master' of https://github.com/Miodec/monkey-type
This commit is contained in:
commit
df07f2b497
3 changed files with 20 additions and 0 deletions
|
@ -42,5 +42,9 @@
|
|||
{
|
||||
"name": "gibberish",
|
||||
"type": "script"
|
||||
},
|
||||
{
|
||||
"name": "58008",
|
||||
"type": "script"
|
||||
}
|
||||
]
|
|
@ -289,3 +289,13 @@ function secondsToString(sec) {
|
|||
ret += secondsString;
|
||||
return ret;
|
||||
}
|
||||
|
||||
function getNumbers() {
|
||||
let randLen = Math.floor(Math.random() * 7) + 1;
|
||||
let ret = "";
|
||||
for (let i = 0; i < randLen; i++) {
|
||||
randomNum = Math.floor(Math.random() * 9) + 1;
|
||||
ret += randomNum.toString();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -382,6 +382,9 @@ function initWords() {
|
|||
} else if (activeFunBox === "gibberish") {
|
||||
setPunctuation(false);
|
||||
wordsList.push(getGibberish());
|
||||
} else if (activeFunBox === "58008") {
|
||||
setPunctuation(false);
|
||||
wordsList.push(getNumbers());
|
||||
} else {
|
||||
wordsList.push(randomWord);
|
||||
}
|
||||
|
@ -569,6 +572,9 @@ function addWord() {
|
|||
if (activeFunBox === "gibberish") {
|
||||
randomWord = getGibberish();
|
||||
}
|
||||
if (activeFunBox === "58008") {
|
||||
randomWord = getNumbers();
|
||||
}
|
||||
wordsList.push(randomWord);
|
||||
|
||||
let w = "<div class='word'>";
|
||||
|
|
Loading…
Add table
Reference in a new issue