wrap around the word list for daily wordles

This commit is contained in:
Jill 2022-01-13 10:24:11 +03:00
parent 0e8a24d465
commit 097326210c
1 changed files with 1 additions and 1 deletions

View File

@ -168,7 +168,7 @@ main = do
c <- getCurrentTime
let day = round (diffUTCTime c startDate / nominalDay)
putStrLn $ "wordle " ++ show day ++ "\n"
getWord (T.unpack $ randomWords !! day) 1 (map T.unpack validWords)
getWord (T.unpack $ randomWords !! (day `mod` length randomWords)) 1 (map T.unpack validWords)
else do
putStrLn "now you give it a try!\n"
let randWord = map toLower $ getRandomElem g $ filter (\x -> length x == 5 && '\'' `notElem` x) (map T.unpack randomWords)