Loop solutions
Loop the index, to avoid out of range error if the list is exhausted (quite easy to do if the wordlist is modified, as might be what's going on in https://github.com/hannahcode/wordle/issues/63)
This commit is contained in:
parent
f8aa91766d
commit
f6f16b1dc6
1 changed files with 1 additions and 1 deletions
|
@ -21,7 +21,7 @@ export const getWordOfDay = () => {
|
|||
const nextday = (index + 1) * msInDay + epochMs
|
||||
|
||||
return {
|
||||
solution: WORDS[index].toUpperCase(),
|
||||
solution: WORDS[index % WORDS.length].toUpperCase()
|
||||
solutionIndex: index,
|
||||
tomorrow: nextday,
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue