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!

Thursday 7 September 2017

Displaying parameter variables in a window - WSLDIAL error

I was working with Clarion for Windows version 9.1. I encountered the cryptic WSLDIAL internal error 1 error.

Doing some research on Google, I learned that this error had to do with errors in the WINDOW definition. The articles that I encountered during my search mentioned having in the WINDOW definition some USE properties with a leading ? before the variable name where none should have been. This was not my issue.

My issue turned out to be that procedure parameter variables were being used in the USE properties of the WINDOW definition. I declared some local variables that could accommodate the values in the procedure parameters. Assigned the parameter values to their corresponding local variables, and used these local variables in the WINDOW definition. Once this was done, the WSLDIAL error disappeared.

Thursday 2 March 2017

Xamarin Forms Monospace Android Font

If you are using Xamarin Forms cross-platform programming, and the Android monospace font refuses to display, then try changing the FontSize property to a valid value, such as 10.

I had initially used a font size of 8 and the font was not being displayed. The default font was being displayed. As soon as I changed the font size to 10, then the monospace font started to display correctly.