Last active
September 30, 2022 08:26
-
-
Save highfestiva/d6d381ea074f46e834c3bbc1844dd785 to your computer and use it in GitHub Desktop.
Trivial Wordle helper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def find(fn): | |
words = open(fn, encoding='utf8').read().split() | |
template = input('word (_ for unknown): ') | |
missing = input('more letter: ') | |
unwanted = input('other letters: ') | |
for word in words: | |
if len(word) == len(template): | |
for t,l in zip(template, word): | |
if t!='_' and t!=l: | |
break | |
else: | |
for t in missing: | |
if t not in word: | |
break | |
else: | |
for t in unwanted: | |
if t in word: | |
break | |
else: | |
print(word) | |
find('eng-words.txt') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment