Word Search Solver

A screenshot of the word search solver on a desktop.

This JavaScript based word search solver matches the first occurrence of each word on a word grid. It searches horizontally, vertically, diagonally, and of course backwards! The solver is intelligent, so it doesn’t waste time starting searches on characters that couldn’t possibly contain words on the word list. Another time-saving measure that the solver takes is that it will remove (internally) any words it successfully matches from the word list. The result being that the program speeds up as it successfully matches words.

All of the tests and source code that I have used throughout the development of the app are viewable on my Github repository. There is also a live version on github.io. It was quite fun to make, I hope you enjoy it as much as I do!

A comparison of the two methods of inputing word search data, manual and file upload.
There are two methods of uploading data. Manual entry and file upload.

Originally the app only ran using a single file’s data. I’ve since added a custom form with inputs for entering word grids and word lists on the fly. In addition I have added support for uploading files (with drag-n-drop support). After the submit button is pressed the app outputs its search results. Horizontal matches are underlined in blue, vertical matches are bordered on their left and right by white, and the diagonal matches have red text.

Ease of Use

An example of how clicking a word in the search list will highlight the beginning of its match.
The word matches are easily located.

In order to create a smoother user experience I have made use of the Bootstrap library. There are portions of the page that provide information regarding proper formatting, depending on the fields being viewed. Errors alert the user to any issues with the custom inputs.

Match highlighting allows users to click found words in the word list and highlight the beginning of the match on the word grid (reversed words highlight the end of the match). The highlighted matches can be toggled on and off at any time, which makes finding matches on a complex word grid significantly easier.

Detailed Logs

An example of the responsiveness of the app, and its console output.

The JavaScript console in Chrome, Firefox, and Safari will reveal more detailed information on each of the matches. This includes: the row and column where the match starts (or ends, if a backwards word is matched), the direction and orientation of the match, and the word that was matched. Neat!

In recent updates, i’ve slightly modified the logs to display how many words have been matched out of those provided, as well as the speed of each search (in milliseconds).