Sample Puzzle Output
I decided that I should let anyone use the crossword puzzle generator program that I wrote. The Windows executable file can be downloaded from my site for your own personal use.
Get it here.
The Input Dialog Box
Do people still call the popup boxes with forms “dialog boxes”? I’m not sure about the current state of terminology but it will always be a dialog box to me. The picture above shows the dialog box that accepts input data for the program. This will show up as soon as crossword.exe is run.
Width and height settings are are self-explanatory. The Start In Corner option causes the first word, whatever one is chosen randomly, to be placed in the upper left corner of the puzzle. The Clump Score is given to each clump of 4 letters. A clump of four letters is a 2 by 2 square of letters where each of four words depends on two others.
The Overlap Score is given to each letter shared by two words. The Word Score is given for each word of the list that is used.
The scoring can be adjusted to get the desired type of puzzle. I always opt for a high clump score because clumps are cool. Doing this might cause the best puzzle to be missing words from the list. If using all words is important, increase the word score. Experimentation is needed to get a good puzzle.
The File Menu
Picking Generate Puzzle or Save Puzzle Bitmaps from the file menu will stop the puzzle generation. Two bitmaps can be saved at the same time, one without the words filled in and one with the words filled in. These can then be inserted into a web page or printed document. It is up to you to create the clues and add them to the puzzle document.
When this runs on my computer, the best puzzle usually shows up within two or three minutes. Sometimes a better puzzle is found a few minutes later but I just let it run all day in case there is something better that just didn’t show up right away. Since this generates puzzles randomly and a lot of garbage puzzles are generated and thrown out, there is no predicting when a good puzzle will show up. The clumping algorithm causes a lot of garbage puzzles to get partially generated then thrown out.
The best scoring puzzle so far is always displayed in the window.
This may not run on all Windows systems. I did not attempt to make this a fully self-contained install package. Feel free to add comments to this post if there are problems getting it to run but I cannot guarantee that I can fix it.
I would also be happy to run it if given a word list as long as I don’t get too many requests. No matter who runs this, the end result depends on the words in the puzzle and how they can be fit together. With a small word list, it is very likely that there are no words that can be clumped. The more words the better the puzzle.
Hello Dave, what type of ADT is your crossword puzzle generator? Is it brute force? (I’m sorry if this is a silly question)
The crossword puzzle generator uses a very simple brute force algorithm. The code just randomly places words until it find a puzzle that doesn’t break any rules. The only thing clever in any of the code is the way it detects when a placement if good or not. I can’t remember the details because it’s been a few years since I wrote it. I also wrote it more than once so there are remnants in the code of previous versions so I cant remember which techniques I used in the final version.
Do you want the source code?
Thanks for clarifying my question. :D I just couldn’t see how the flow goes.
If it’s okay for you to share your source code, then I’d very much appreciate your help.
Here ya go…
http://www.rectorsquid.com/crosswordsources.zip
I can’t guarantee that it will make sense or that you will like the source code. I modified it at least three times while working on it and it got sort of confusing to edit after a while. But it works pretty well. Try making a puzzle with words like MANY, UNTIL, YES, TEST, EMPTY, THIS, THE, TYPE and see what you get. I saw a few cool word interactions with some of these words.
Dave