This is a done-in-a-day-that-became-a-week-or-more project i came up with for scoring the best starting word in Wordle (I know I'm late). I won't say that this is a perfect way of doing this, but i thought it would be a fun exercise :)
By running the GetBestWord.py
file, you will iterate through the word list file and give each word a score.
This score is based on how many times X letter appear in Y spot.
The GetBestWord.py
file does 3 things.
- First it will run through the word list file that is set in the script, and give each letter in X spot a score.
This score is based on how many times this letter appear in that column (Index, starts at 0).The score is set from 0 to 25
Word | Index 0 | Index 1 | Index 2 | Index 3 | Index 4 |
---|---|---|---|---|---|
arose | A 1 | R 1 | O 1 | S 1 | E 1 |
adder | A 1 | D 1 | D 1 | E 1 | R 1 |
seder | S 1 | E 1 | D 1 | E 1 | R 1 |
Total</>Points | A 2 S 1 |
R 1 D 1 E 1 |
0 1 D 1 E 1 |
S 1 E 2 |
E 1 R 2 |
- It will then go through all the words and give them a score based on which letters the word consists of.
- If the letter contains two or more of the same letter, that letter will only count once.
Letters | A | R | O | S | E |
---|---|---|---|---|---|
Letter Score |
19 | 23 | 23 | 22 | 24 |
Total Score for Arose: 111
Letters | C | A | D | D | Y |
---|---|---|---|---|---|
Letter Score |
23 | 25 | 15 | 2 |
Total Score for Caddy: 065
Notice how the second D did not count
- Sort this list by Score, and Voila! You have the
Result.csv
file as provided!
This script goes through these instructions in a loop:
- Find the word that fits the current attributes. An example of this would be; Has to contain a "H" in index 1 (Green Letters), and the letters "E" and "L" somewhere (Yellow letters).
- On first run, this is the first entry in
Result.txt
.
- On first run, this is the first entry in
- After you enter that word into Wordle, it will ask which letters became green, and which became yellow, and add them to separate lists. The rest of the letters in the current word, get automatically added to it's own list.
- Updates the green and yellow lists, to make sure that there are no yellow entries in the green list.
- For every word it guesses, it will add these to another list, so that we don't get repeated guesses.
- And repeat the loop.
If you are going to use this tool on the NYTimes site, use the wordlistNYTimes.txt
For all my testing i have used Infinite Wordle by Greg Cameron with the wordlistInfiniteWordle.txt
file.
Some ideas that can be created at a later date:
-
A solver that gives advice about which word you should guess next.
This could be done like this:[x] Give the top scoring word as suggestion
[x] Ask which letters became green, yellow, and black (in a for loop or something.)
[x] Give next suggestion based on this information. \ -
Webapp?
- infinite Wordle, to see exactly how accurate this method is?
- Might be a good way to start learning reactJS?
-
Make this more user friendly:
- Select desired word list at beginning
- Default selection
- Make suggested words easier to notice inside terminal (Different colors etc.)
- Select desired word list at beginning