Skip to content

Instantly share code, notes, and snippets.

@highfestiva
Last active September 30, 2022 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save highfestiva/d6d381ea074f46e834c3bbc1844dd785 to your computer and use it in GitHub Desktop.
Save highfestiva/d6d381ea074f46e834c3bbc1844dd785 to your computer and use it in GitHub Desktop.
Trivial Wordle helper
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