4 ms·
Great writeup! I'm self-taught so I worked kind of naively on a different approach: https://news.ycombinator.com/item?id=30050231 https://news.ycombinator.com/i
by tomlockwood 5y ago
Great writeup! I'm self-taught so I worked kind of naively on a different approach: https://news.ycombinator.com/item?id=30050231 https://news.ycombinator.com/item?id=30050231
I'm hoping to get the 3.4 result, soon, in a Rust program I'm writing!
- jonathankoren 5y agoI’ve been playing with your Python version and comparing it to my heuristic approach. We’re both basically playing hard mode with letter position frequencies, but for some reason yours is slightly better, although I’m not sure why. Also, yours runs much faster than mine, probably because I’m using a regex instead of a proper positioning index. I’ve been playing with various strategies, but position frequency of single letters has been the best one I’ve come up with. Even factoring factoring in the frequencies of bigrams is worse. Kind of depressing that my first guess was the best. I’ve been explicitly avoiding incorporating knowledge that there is a target dictionary and legal guess dictionary. It seems like cheating, but it looks like the optimal bots use that information. My next strategy is to explicitly calculate coverage of the words, instead of using probabilities. (FWIW, all my statistical approaches suck horribly. :/ ) https://github.com/jonathankoren/wordle-solver https://github.com/jonathankoren/wordle-solver
- NathanOsullivan 5y agoIMO using the guess list is fine. Since the game rejects words that are not in the guess list without penalty, it could easily have been brute forced if it was not easily obtainable from the implementation.
- tomlockwood 5y agoI spent a bit of time using cProfile in Python to see where my program was slow, and optimize. Some dict initialization was also slowing me down, but my feeling also is that regex will probably be a fair bit slower than the string comparison. Also yeah, my next attempt is going to do some other stuff, I moved to rust to speed it up, but its mostly a learning exercise. Thanks for sharing!
- jonathankoren 5y agoFWIW, feeding both of ours only the target dictionary: "Score" is the sum of all the guesses, with 7 for losses. Yours: Wins 2302 Losses: 13 Surrenders: 0 Played: 2315 WinPct 99.438 % Number of attempts to win: mean: 3.644811 Score (lower better) 8485 Winning Histogram 1 | 0.04 % | (1) 2 | 6.34 % | ### (146) 3 | 37.36 % | ################### (860) 4 | 43.31 % | ###################### (997) 5 | 11.08 % | ###### (255) 6 | 1.87 % | # (43) Mine: Wins 2297 Losses: 18 Surrenders: 0 Played: 2315 WinPct 99.222 % Number of attempts to win: mean: 3.626034 Score (lower better) 8455 Winning Histogram 1 | 0.04 % | (1) 2 | 5.75 % | ### (132) 3 | 40.81 % | #################### (937) 4 | 40.72 % | #################### (935) 5 | 10.37 % | ##### (239) 6 | 2.31 % | # (53)