mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-08 13:11:19 +08:00
using actual words length instead of the loop variable
This commit is contained in:
parent
42e1dde25a
commit
2230e6d900
1 changed files with 5 additions and 5 deletions
|
|
@ -868,14 +868,14 @@ export async function init() {
|
|||
} else {
|
||||
for (let i = 0; i < wordsBound; i++) {
|
||||
let randomWord = wordset.randomWord();
|
||||
const previousWord = words.get(i - 1, true);
|
||||
const previousWord2 = words.get(i - 2, true);
|
||||
const previousWord = words.get(words.length - 1, true);
|
||||
const previousWord2 = words.get(words.length - 2, true);
|
||||
if (
|
||||
Config.mode == "custom" &&
|
||||
!CustomText.isWordRandom &&
|
||||
!CustomText.isTimeRandom
|
||||
) {
|
||||
randomWord = CustomText.text[i];
|
||||
randomWord = CustomText.text[words.length];
|
||||
} else if (
|
||||
Config.mode == "custom" &&
|
||||
(wordset.length < 3 || PractiseWords.before.mode !== null)
|
||||
|
|
@ -933,9 +933,9 @@ export async function init() {
|
|||
|
||||
if (Config.punctuation) {
|
||||
randomWord = punctuateWord(
|
||||
words.get(i - 1),
|
||||
words.get(words.length - 1),
|
||||
randomWord,
|
||||
i,
|
||||
words.length,
|
||||
wordsBound
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue