3 ms·
Are you using only the answer words as guesses? I have a decision tree that averages 3.67 guesses [0], so a bit worse than yours, but the maximum guess length
by hinoki 5y ago
Are you using only the answer words as guesses?
I have a decision tree that averages 3.67 guesses [0], so a bit worse than yours, but the maximum guess length is 5. My heuristic is to search for trees by looking at how the guesses split the remaining answers by their match patterns. For each guess, create a map from match pattern to the count of answers with that pattern. Order guesses by the sum of the squares of answer counts (to penalise patterns with lots of answers). Evaluate sub-trees for the top 2^(6 - depth) guesses.
[0] https://github.com/perigean/wordle/blob/main/tree.txt https://github.com/perigean/wordle/blob/main/tree.txt
- MereInterest 5y agoOoh, interesting! I ended up making a framework to test different strategies. The minimax strategy is the most similar to yours, but it orders guesses by the maximum number of answer counts, and doesn't check any of the sub-trees. It still has a maximum guess length of 5, but has a slightly worse average at 3.81 guesses. Edit: How often do you need to evaluate sub-trees as a tie-breaker? I re-implemented your strategy of selecting the guess that minimizes the sum of the squares of the counts, but didn't include the evaluation of sub-trees. That was enough to reproduce your 3.67 average, (`{2: 23, 3: 802, 4:1416, 5:74}`), without the sub-tree recursion.
- maxerickson 5y agoHow would your approach work against random 20 character strings? I feel like calculating the possibility space for such a small game doesn't really reveal a lot (because we can just observe that it is a small game in that sense).
- bwuk 5y agoI've got a solution that filters the answer space down each guess, picking words with most common letter frequency and common letter position as a tie breaker. Avg is 3.7 guesses, worst case is 6 over the entire wordle dictionary. I don't think it would have any issues scaling to 20 letter words. https://github.com/mschrandt/Wordle https://github.com/mschrandt/Wordle
- tomlockwood 5y agoHey I did a little write up: https://news.ycombinator.com/item?id=30050231 https://news.ycombinator.com/item?id=30050231