Possible algorithm
samstone19943 opened this issue · 0 comments
Here is an algorithm I came up with::
1. Get an English dictionary. Let wordList = dictionary, let wordSize = 5, let previousMatches = empty list of triples, where each triple is of the structure (color, letter, index in match result)
2. Guess random words from wordList until any matches are found. Prefer words with more vowels for first guess.
3. If any matches, set previousMatches
4. Filter wordList for words which contain green letters at the index of previousMatches and yellow at any index in the word. Now you have a list of possible matches.
While previousMatches.size != wordSize:
5. Guess random words from wordList until number of matches is greater than previousMatches.size, then reassign previousMatches.
6. If reassigned, filter wordList by previousMatches.
7. Once done loop, print out previousMatches (which is answer)