4 ms·
the most interesting part of this imo is the heuristic it uses to find the most likely word: # Greatly penalize words that have multiple of the same black
by eat_veggies 5y ago
the most interesting part of this imo is the heuristic it uses to find the most likely word:
# Greatly penalize words that have multiple of the same black letters
# Greatly penalize words that have the same black letters as any seen word
# Greatly penalize words that have the same yellow letter/index pair as any seen word
# Reward words that have yellow letters that match yellow letters in seen words, but in different positions
# Reward words that have yellow letters that match green letters in seen words
# Penalize words that have yellow letters that don't appear in seen words
# Penalize words that have green letters that don't appear in seen words
# Rewards words based on commonality
# Reward/penalize words based on line indexes and common letters
I built something similar to this that just lists all the possible words, and is nowhere near as smart -- but it lets you draw pretty pictures! https://jse.li/wordle-reverse/ https://jse.li/wordle-reverse/
- mattlock 5y agoI honestly thought I removed those comments lol. They might be a little outdated, but yeah, I spent a lot of time thinking about what kinds of information I could glean. There's definitely some bias in there towards a certain kind of strategy/play. I like your project, very creative!
- ghaff 5y agoLooking at the parent run, my first thought was that its initial guess is a relatively uncommon word and is (I assume) probably not a very good choice as an initial guess. There are various lists of the best starting words in order going around. I wonder if you could get to the best results by picking the highest ranked word consistent with the other lines?
- mattlock 5y agoI thought about using lists like that, but it felt a little too much like cheating. My attempt at something like this is, if the word is one of your first two guesses, I reward it for having more common letters. And actually penalize common letter "misses" in later lines. I'm sure it's not 100% optimal, but I saw some improvement on my admittedly very limited set of test data. Here's the relevant code - https://github.com/mattruzicka/wordle_decoder/blob/0bfd7eaacd14aab0c8a0971fe1bbb43a76ad5ff8/lib/wordle_decoder/word.rb#L32 https://github.com/mattruzicka/wordle_decoder/blob/0bfd7eaac...
- ghaff 5y agoOf course, doing what I wrote also makes the assumption that the person playing is using one of the top 10 (or whatever) starting words which may or may not be correct. That aside, I started playing a 6 letter variant and, while I haven't done any sort of analysis with access to the word list, I did do a quick Word Hippo analysis of words with common letters, especially vowels, and while I'm sure my results aren't optimal they're probably pretty good. ADDED: Which I think is probably not all that different from what your code is doing. I fed Word Hippo 4 or 5 letters and told it to come up with some common words. But that still requires an assumption that a player has given some thought to good starting guesses.