Project: Word Search Solver
Throughout my high school classes, one category of homework assignments which never failed to show up time and time again were word searches. Whether it was a Spanish vocabulary word search or something for a history class, I could be sure that at least a few times a month I'd be scratching my head looking for the last word in a puzzle. Until some time in tenth grade when I got tired of it.
Now I'm sure there's an online word search solver somewhere that I could probably find Googling around, but that's no fun. Instead I got familiar with the Java's Swing interface by designing my own word search solver.
The logic behind finding a word in a matrix of characters is really quite simple. First, look for the first character in the word (label it's position [x,y]). If the first character doesn't exist, obviously the word isn't in the word search. If it does, then determine the string that originates at [x,y] for each of the eight directions, namely N, NE, E, SE, S, SW, W, and NW. In other words, start at [x,y] and shoot a ray down each direction. If any of those strings matches the original word, then there's a match. If not, then continue looking for the next occurence of the first character in the word.
With just a few edge-case checks I was able to adapt my program so that it worked not only for rectangular word searches, but more generally any lines of strings. After that, I decided to add an "Import" feature with which you could load an ASCII text file into the Word Search grid. Unfortunately the program itself is a standalone application and not an applet so it can't be run online. If you're interested, use the form at the bottom of the page and I'd be glad to send the source and the final program to you.
Click the picture above to run the Word Search Solver.