Sign in to follow this  
codeman_nz

Crossword generator

Recommended Posts

codeman_nz    255
Hi everyone,

I want to create a crossword generator which also minimizes the number of blank squares.

So it would take a list of words and place them where the number of blank squares was 40 or less.

But I have no idea how to go about this. Any ideas?

Share this post


Link to post
Share on other sites
Riphath    151
I can think of a number of ways to make a crossword generator, but I'm not sure about that second qualification. [url="http://thecodist.com/article/building_an_automated_crossword_puzzle_generator"]Here's[/url] an article which talks about making a crossword puzzle, and it links to one written in C, which has the source if you want to look at it (if you can't read C, I only spent a short time looking so I'm positive there's something else out on the net, you'll just have to look).

But getting the least amount of blank spaces is a tough one for me. I know there's a way to do it, I just can't think of it right now. Sorry, but I hope that helps.

Share this post


Link to post
Share on other sites
Riphath    151
I should clarify, by blank spaces you mean the unused squares and you want the words to intersect as often as possible and use the space in the most efficient way, right? Because the only way I can think to do that would be brute-force, and that generator written in C does just that. But brute-force is probably not what you want, because that could take a very very long time. The article I linked you to even touches on that a little, but he doesn't mention how he solved it.

The best advice I could give you would be to try and find as many examples and bits of source code of crossword puzzle generators as you can find and look at how other people did it. I think this is one of those deceptively difficult problems, so you might want to find something else to try if you don't think you're up for the challenge. Otherwise, I wish you the best of luck!

Share this post


Link to post
Share on other sites
Poigahn    598
Years ago I wrote a word search puzzle generator in GW-Basic ( Did I say Many Years Ago ). Both a Crossword puzzle and word search are simular so Here is what I did, This May Help you. Let me know if it does....
First - You are going to need a large list of words with a set of clues. Example :
Apple
Clue 1 = Edible Fruit
Clue 2 = Grows on Trees
Clue 3 = Forbidden in the Garden of Edan
Get the idea.
Here I would create a stand alone program to enter and store this information, I would also include a small list of catagories attached to each word since most crosswords are theme based.
Next generate a 2 dimentional array to hold each letter of each word. (13,13) is a common size
Have the program start filling in the array. Then search for words that cross fill in the array. searching through each word to makesure it fits. I would use a number in the next subscript to indicate a noletter tile.
This would be a hefty challenge from scratch. Good Luck.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this