Friday 8 September 2017

Framework puzzle solver


I occasionally buy variety puzzle magazines. I enjoy doing the puzzles. One of my favourite types of puzzle is the framework puzzle. These are square grids, similar to crossword puzzle grids. There are no clues given, only the list of words that must be filled into the grid.

I had recently purchased the October 2017 edition of Approved Variety Puzzles, published by PennyPress. I had completed a number of the Framework puzzles. I noticed that they had an expert puzzle at the end of their series of puzzles. I was about to tackle this expert puzzle when I decided that it would be more fun for me to write a program to solve the puzzle. Being a software engineer, this was an option for me.

It took me a couple of days to complete the code and the testing of the program. The program solved the expert puzzle in a matter of seconds.

The program works as follows:

  1. Select the dimensions of the puzzle grid. (The expert puzzle is a massive 25 by 25 beast.)
  2. Right-click on those squares that are void in the puzzle. This takes the most time.
  3. Enter the list of words. (This program does not need the hint word that the easier Framework puzzles provide.)
  4. Click on the Solve puzzle button and wait for the result to appear in the grid.
I added a feature to save and load puzzles. I have added the expert Framework puzzle. It is the file named expert.puz. The file may be loaded from the toolbar menu.

The code takes a while to create and initialize the 625 (25 times 25) label objects that populate the puzzle grid. So, be patient.

There is no code to edit misspelled words. You can add that yourself.

I am publishing the code in case anybody else is interested in seeing it in action, or studying it, or offering comments on how to improve any part of the code.

Click HERE to download the Visual Studio 2015 C# solution encoded in 7-zip format.

Let me know what you think!

No comments:

Post a Comment