Word Search Instead

September 22nd, 2016

I was going to write some posts about the latest version of the AutoResponder but I got side tracked on making a word search puzzle generator.


Word Search Generator

I was trying to make a puzzle by hand and it was clear that it’s hard to do. I then tried to use some free web-based software and it was clear that there was no way to create an overlay to more easily check answers. And finally, I needed to create a UWP app as practice for work – we might need to have this type of app sometime in the future.

I found one person online who described the algorithm that they used for their generator. After working on implementing it, I decided that it was overkill. Their algorithm, upon finding a word that can’t be placed anywhere, would remove and try to re-place the previous word in a different location. If that previous work cannot be placed somewhere new, the algorithm repeatedly backs out previous words until it can progress forwards and finish the puzzle. This isn’t so good if there isn’t enough space to place all of the words – the algorithm runs for a very long time. I found that it’s better to just start over with new random placements if any word cannot be placed. It essentially does the same thing but just backs out all words instead of just the previous word. The algorithm is simpler and also lets my app return partially completed puzzles.

Other than the cool feature of exporting PNG image files, I also let the user decide if they want just the ovals around the answers with no letters filled in. This might be good for creating a transparent overlay for checking other peoples work on the puzzle.

It’s not open-source but I would be happy to share with anyone who seem sincere about wanting to have this for their own personal projects.

So like I said it’s a UWP app written in C# so it runs on my laptop and on my phone, both running Windows 10.

Leave a Reply

You must be logged in to post a comment.