Programming — NYT Spelling Bee Solver (and creator)

Aaron Santa Cruz
4 min readOct 25, 2020

--

Bzzzz! - SPOILERS FOR OCTOBER 25TH’s GAME!

The project was to create a NYT spelling bee solver. My father has always been fond of the game, and usually finds all of the words required. The game is a word spelling game. Today’s game (October 25th) looks like this Note that later in this article, there are some answers to this game:

October 25th’s Spelling Bee

The objective of the game is to spell as many words as possible that are at least four letters long, and include the middle letter. In this case, “A” was the middle letter. You get points for each word, and you win the game when you find all of the games.

Some example answers include “moat”, “auto”, “taco”, and “factotum”.

I used Python 3 to create the game solver. The solver has a simple web interface:

NYT Spelling Bee Solver

To sum up the solver, it takes in all of the letters and creates a list of every single possible combination of words:

After it gets every single possible word, it creates a dictionary with the key being the length of each word. Then, it goes into a loop and gets every single word that is at least length four, and checks them against the dictionary. A dictionary might look like this:

final = {4: [“back”, “grow”, “love”], etc…}

The code to generate this:

Let’s solve October 25th’s game by inputting the inside and outside letters into the solver:

Inputting the letters to solve

After letting the code run, get every single combination of those words, and check them in a dictionary (all at least length 4), we get this output (also note that the dictionary has some very obscure words. Some of these answers are not actually an answer):

4 Letter Words
5 Letter Words
6, 7, and 8 Letter Words

As you can see, the solver produces a lot of words. There’s also an api on the solver that is called at https:[url]/api/create?out=[outside letters]&middle=[middle letter]:

Code for calling solver API (javascript)

Making the game creator was the next step. To sum up the creator, it calls my api (shown above), and gets back a list of words that use your letters that you enter (I used n,g,l,p,r,t as the outside letters and “a” as the middle letter:

Honeycomb Puzzle — Create your own game

After you click “create puzzle” a response of “Fetching Data From Server” will show up, and you are left with:

Created Puzzle

So let’s take one of the answers of this puzzle, “part” and type it in. Then hit enter button:

Solving the puzzle- Word: “part”

We get a message saying “Correct!” as that is a word in the puzzle, and a word in the english language. If you were to get stuck, you could use the solver, and see the answers to the entire puzzle.

In conclusion, the solver provides a ton of answers (some in the actual NYT game), and the creator is a better version of the NYT game, as it has every possible word in the dictionary. If we were to not include the center letter, or not provide at least four letters, it would tell you.

If you are interested at looking at the code, go here:

https://github.com/aaron-sc/NYT-Spelling-Bee-Project

--

--