WSJ's Spelling Bee solver
Published: Wed, May 15th, 2024I've come across Spelling Bee while playing Wordle. They are both word games hosted by Wall Street Journal.
The game provides the player with 7 letters, of which 1 has to be included in the word. The player's task is to include the middle letter and some combination of all letters with replacement. The length of the word has to be at least 4.
The solver
The solver generates a list of words from a list. The basic idea of the solver is to remove all words that don't contain the mandatory letter, then any words that contain any letters besides the allowed 7.
I also wrote a dictionary prunner, though probably unnccesarily so. I hoped that I can reduce overheads by reducing dictionary size by removing all words that are not allowed in the game (too short, or contain more than 7 distinct characters). In reality, the script finishes almost instantaneously.
I further found the list of words naturally tedious to type out. The labour is outomated by running a script in the browser, via the developer console. You can copy and paste the js solver file generated by the main solver script, and watch it strike off all the words one by one.