24 lines
548 B
TypeScript
24 lines
548 B
TypeScript
import { WORDS } from '../constants/wordlist'
|
|
import { VALIDGUESSES } from '../constants/validGuesses'
|
|
|
|
export const isWordInWordList = (word: string) => {
|
|
return (
|
|
WORDS.includes(word.toLowerCase()) ||
|
|
VALIDGUESSES.includes(word.toLowerCase())
|
|
)
|
|
}
|
|
|
|
export const isWinningWord = (word: string) => {
|
|
return solution === word
|
|
}
|
|
|
|
export const getWordOfDay = () => {
|
|
// January 1, 2022 Game Epoch
|
|
|
|
return {
|
|
solution: WORDS[0].toUpperCase(),
|
|
solutionIndex: 0,
|
|
}
|
|
}
|
|
|
|
export const { solution, solutionIndex } = getWordOfDay()
|