mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-09-22 16:26:18 +08:00
fixed number appearing in wrong places with punctuation enabled
This commit is contained in:
parent
cd6afb4b30
commit
dc06badad3
|
@ -469,8 +469,15 @@ export async function init() {
|
|||
randomWord = punctuateWord(previousWord, randomWord, i, wordsBound);
|
||||
}
|
||||
if (Config.numbers) {
|
||||
if (Math.random() < 0.1) {
|
||||
if (
|
||||
Math.random() < 0.1 &&
|
||||
i !== 0 &&
|
||||
Misc.getLastChar(previousWord) !== "."
|
||||
) {
|
||||
randomWord = Misc.getNumbers(4);
|
||||
if (i == wordsBound - 1) {
|
||||
randomWord += ".";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue