Last active
September 1, 2025 17:07
-
-
Save mdwhatcott/c0039015aa1e2f74ae640778dd7e6bee to your computer and use it in GitHub Desktop.
NYT Spelling Bee Solver
This file contains hidden or 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
| # 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