mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-21 15:56:24 +08:00
added dots to 58008 with punctuation
This commit is contained in:
parent
6820dbcb03
commit
ccef26527e
|
@ -85,9 +85,23 @@ export async function punctuateWord(
|
|||
|
||||
if (Config.funbox === "58008") {
|
||||
if (currentWord.length > 3) {
|
||||
if (Math.random() < 0.5) {
|
||||
word = Misc.setCharAt(
|
||||
word,
|
||||
Misc.randomIntFromRange(1, word.length - 2),
|
||||
"."
|
||||
);
|
||||
}
|
||||
if (Math.random() < 0.75) {
|
||||
const special = ["/", "*", "-", "+"][Math.floor(Math.random() * 4)];
|
||||
word = Misc.setCharAt(word, Math.floor(word.length / 2), special);
|
||||
const index = Misc.randomIntFromRange(1, word.length - 2);
|
||||
if (
|
||||
word[index - 1] !== "." &&
|
||||
word[index + 1] !== "." &&
|
||||
word[index + 1] !== "0"
|
||||
) {
|
||||
const special = Misc.randomElementFromArray(["/", "*", "-", "+"]);
|
||||
word = Misc.setCharAt(word, index, special);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue