Debra at Contextures blogged about creating a word search puzzle while she nursed a hangover (although she won’t admit it). Creating a word search puzzle in Excel seemed like a fun exercise, so I set about doing it.
It’s not even close to finished, I’m just throwing the first draft out there to see what sticks. I have some design considerations.
The puzzle dimensions are set in A1 and the word list starts in A2. If a word is too big, you get an (currently unhandled) error. Perhaps I should allow the user to set the minimum puzzle size, but compute the correct puzzle size based on the word list. I haven’t thought about that algorithm much, but I think I’d start with
Longest Word / 0.8. That would have to increase based on the number of long words. The more long words, the larger the puzzle will have to be to accommodate them all.
As it is now, if a word is greater than 80% of the puzzle dimensions I force the direction to be diagonal. If I don’t, the rest of the words use the same direction as the first word. For example, if SUMPRODUCT goes horizontally from row 4, column 1, then the odds are pretty good that the next three words will have to be either horizontal right or horizontal left. The only way they wouldn’t be horizontal is if, by luck, they meshed with SUMPRODUCT.
Any cells that aren’t part of a word are filled with a random letter. I’d prefer to fill some spaces with partial words, like MPROD, to make the puzzles harder. That will make the code run longer and it will increase the chance that I accidentally make a duplicate. I’d have to avoid that for small words, say five characters or less, which I think would make the odds of a duplicate almost nothing.
You can download the zip file if you want to check it out. If you have thoughts on how you’d design the puzzle, leave a comment.