Comments on Wordle With Grep
Jana said:
I solved them with Awk.
Wordle #217:
$ alias words='awk '/^[a-z][a-z][a-z][a-z][a-z]$/' /usr/share/dict/words' $ words | awk '/^....e/ && !/[aros]/' | head -n 5 beige belie belle bible bilge $ words | awk '/[^e][^e][^ie][^e]e/ && /i/ && !/[arosbg]/' | head -n 5 fiche indue lithe mince niche $ words | awk '/[^e]i[^iec][^e]e/ && /c/ && !/[arosbgfh]/' | head -n 5 mince wince $ words | awk '/[^e]ince/ && !/[arosbgfhm]/' | head -n 5 wince
Wordle #218:
$ words | awk '/.r.../ && !/[aose]/' | head -n 5 brick bring brink briny bruin $ words | awk '/.ri[^c]./ && /c/ && !/[aosebk]/' | head -n 5 crimp
Wordle #219:
$ words | awk '/..o../ && !/[arse]/' | head -n 5 block blond blood bloom blown $ words | awk '/.[^l]o.[^k]/ && /l/ && /k/ && !/[arsebc]/' | head -n 5 knoll
Fillon said:
Also, the letter 'e' does not occur anywhere apart from the fifth place.
There can be repeated letters!
Susam Pal said:
Fillon,
I am aware that there can be repeated letters. In fact, Wordle #219 ("knoll") does indeed have repeated letters. However, in Wordle #217 we can be sure that there is no repeated letter 'e'.
In Wordle #217, after we enter the word "beige" as the second guess, the result has the letter 'e' in a green tile and another occurrence of the letter 'e' in a gray tile. The gray tile containing 'e' confirms that there is no repeated letter 'e'. Here is how the second result looks:
B E I G E
If there were no occurrence of 'e' in an unsolved tile in the result above or if there were another 'e' in a yellow tile, then a repeated 'e' could have been present. But in the result above, we have another 'e' in a gray tile. This gray tile guarantees that the letter 'e' does not repeat in the solution.
Fillon said:
Susam,
Thanks for the explanation. I did not notice earlier that the result has an extra 'e' in a gray tile. You are right. Since the extra 'e' has been evaluated and marked gray, it cannot occur as a repeated letter.
Phoebos said:
Nice! I like the systematic approach.
The problem occurs if there are many words that differ from the target word by only one letter, e.g., bears, fears, gears, pears, tears, wears, years - in this case, it would be most useful to create a word using as many of those first letters as possible - for example, "befit" with b,f,t - so that only one guess is used up to find what the first letter is.