added dots to 58008 with punctuation

This commit is contained in:
Miodec 2022-05-03 13:59:37 +02:00
parent 6820dbcb03
commit ccef26527e

View file

@ -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 {