Skip to content

Instantly share code, notes, and snippets.

@mdwhatcott
Last active September 1, 2025 17:07
Show Gist options
  • Select an option

  • Save mdwhatcott/c0039015aa1e2f74ae640778dd7e6bee to your computer and use it in GitHub Desktop.

Select an option

Save mdwhatcott/c0039015aa1e2f74ae640778dd7e6bee to your computer and use it in GitHub Desktop.
NYT Spelling Bee Solver
# Official Game: https://www.nytimes.com/puzzles/spelling-bee
# Knockoff Game: https://spellsbee.com/
required = 'c' # The letter in the center of the hexagon.
possible = set(required+"terubh") # The letters around the center letter.
results = set()
with open('/usr/share/dict/words') as d:
for line in d:
line = line.strip().lower()
if len(line) < 4:
continue
if required not in line:
continue
if not set(line).issubset(possible):
continue
if set(line) == possible:
results.add("**** "+line+" ****") # Words that use all letters!
else:
results.add(line)
for result in sorted(results):
print(result)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment