by vple · 4y ago · 0 comments
There's probably more tuning I can do for the algo, but roughly:
- I took all the words from the site's js as the dictionary.
- From remaining eligible words, compute the letter distribution (ignoring letters you already know are in the solution).
- Pick a word that uses as many of the most frequent letters as possible.
- Use one of those as a guess.
The goal is essentially to greedily reduce the remaining candidate words as much as possible per guess.
I do wonder if looking at how a letter splits the space of letters and words would be interesting
I think if I work on this some more I'd try to factor in letter positioning when deciding what to guess. My hunch is that it won't make too much of a difference though.
Variations included adding in the frequency of the letter at a particular position, and adding in the frequency of two letter combinations.
Interestingly enough, the winning strategy was using single letters and using figuring in the position. Second second best was using two letters and position.
ngram=1 posfreq=True mean attempts: 4.34 WinPct 91.280%
ngram=2 posfreq=True mean attempts: 4.35 WinPct 91.186%
ngram=2 posfreq=False mean attempts: 4.37 WinPct 90.074%
ngram=1 posfreq=False mean attempts: 4.38 WinPct 90.445%
Since my base dictionary is way bigger than the Wordle one, I also mixed in a smaller 1,382 word dictionary (google-10000-english.txt) and then combined them by either just sorting by the score, or normalizing the scores, and then sorting. Normalizing the scores was strictly worse.
normalize=False ngram=1 posfreq=True mean attempts: 4.34 WinPct 91.280%
normalize=True ngram=1 posfreq=True mean attempts: 4.43 WinPct 90.281%
FWIW, the absolute worse one was:
normalize=True ngram=1 posfreq=False mean attempts: 4.43 WinPct 89.835%
I should write this up.
Another comment mentioned https://botfights.io/game/wordle, if you evaluate your solver on their word list you could compare scores.