Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Wordle is a daily puzzle where you try guess a word drawn from a corpus of 12,972 five-letter words. Each time you guess, you are told which letters were correct, and you can use that information in a subsequent guess.
The result of a guess is called a "mask". When we guess "tiger" for "gazer", we get the mask "bbygg" (black-black-yellow-green-green), which means that "g" is in the wrong place, and "e" and "r" are in the right place.
What is the optimal word to guess at each stage? It is the word that delivers the most information.
Suppose there are 5 words left we are considering two guesses; "zebra" might yield mask1 with 3 words and mask2 with 2 words; and "tiger" might yield mask3 with 4 words and mask4 with 1 word. "Zebra" is a better choice, because the largest group (mask1 with 3 words) is smaller than "tiger"'s largest group (mask 3 with 4 words).