Wordle Helper Program
Goal
Write a program to show possible solutions to Wordle
Input
Letters we know are not in the word
Letters we know are in the word but not where
Pattern containing letters in the right positions
Word list
Output
List of possible Wordle solutions from the word list
Approach
Read in word list
Read in letters we know are not in the word ("bad letters")
Read in letters we know are in the word but not where ("good letters")
Read in pattern containing letters in the right positions
Loop (once per word in word list)
Eliminate words that are not 5 letters long
Eliminate words with bad letters
Eliminate words without good letters
Eliminate words that don’t match the pattern
Print the word
Implementation
Read word list [
wordle-1.py
]
Eliminate words that are not exactly 5 characters long [
wordle-2.py
]
Read pattern, good letters, bad letters [
wordle-3.py
]
Check no letters are both good and bad [
wordle-3a.py
]
Eliminate words containing bad letters [
wordle-4.py
]
Make all letters lower case [
wordle-4a.py
]
Eliminate words with no good letters [
wordle-5.py
]
Eliminate words that do not match a pattern [
wordle-6.py
]
If word list named on command line, use it [
wordle-7.py
]
Now clean up the code [
wordle-8.py
]
Empty pattern causes error; check for it
Check for invalid patterns
before
asking for other inputs
Eliminate printing pattern, and good and bad letters
Matt Bishop
Office: 2209 Watershed Sciences
Phone: +1 (530) 752-8060
Email:
mabishop@ucdavis.edu
MHI 289I, Programming in Health Informatics
Version of December 2, 2025 at 10:43AM
You can also obtain a PDF version of this.