mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-05 13:27:49 +08:00
Punctuation mode updated
* single quotes '' * parentheses () * braces {} * brackets []
This commit is contained in:
parent
0af5083d4c
commit
eafc22c36e
1 changed files with 28 additions and 0 deletions
|
@ -726,6 +726,34 @@ function punctuateWord(previousWord, currentWord, index, maxindex) {
|
|||
) {
|
||||
//1% chance to add quotes
|
||||
word = `"${word}"`;
|
||||
} else if (
|
||||
Math.random() < 0.01 &&
|
||||
getLastChar(previousWord) != "," &&
|
||||
getLastChar(previousWord) != "."
|
||||
) {
|
||||
//1% chance to add single quotes
|
||||
word = `'${word}'`;
|
||||
} else if (
|
||||
Math.random() < 0.01 &&
|
||||
getLastChar(previousWord) != "," &&
|
||||
getLastChar(previousWord) != "."
|
||||
) {
|
||||
//1% chance to add parentheses
|
||||
word = `(${word})`;
|
||||
} else if (
|
||||
Math.random() < 0.01 &&
|
||||
getLastChar(previousWord) != "," &&
|
||||
getLastChar(previousWord) != "."
|
||||
) {
|
||||
//1% chance to add braces
|
||||
word = `{${word}}`;
|
||||
} else if (
|
||||
Math.random() < 0.01 &&
|
||||
getLastChar(previousWord) != "," &&
|
||||
getLastChar(previousWord) != "."
|
||||
) {
|
||||
//1% chance to add brackets
|
||||
word = `[${word}]`;
|
||||
} else if (Math.random() < 0.01) {
|
||||
//1% chance to add a colon
|
||||
word = word + ":";
|
||||
|
|
Loading…
Reference in a new issue