views:

521

answers:

2

I need an script for generating crossword game. I have a list of 8 words for which I wnat to generate a crossword game, let's say for 15 column and 15 row.

I am not getting the concept of this problem. How to generate this using PHP ?? Can anyone tell me how to do that ??

A: 

I think that sounds easier than it is in practice, certainly when you only start with a list of 15-20 words. It is very difficult this way to put those words into a crossword. In most cases it will even be impossible...

Fortega
Its not exact, I just added 15-20 for refrence... It can be less word.
Prashant
I think Fortega meant that it's easier to start with a list of ALL words (hundredthousands), and then find a crossword solution from that, with 15-20 words in it.
0scar
Ok ..............................
Prashant
yes, that is true, Oscar
Fortega
A: 

I think this is a fun idea and i will try that some time, should be possible. Of couse you never know if there is a posibility for the given words in the given size, but if you try tons of combinations with an algorithm i think that should get some "acceptable" results.

I'd just start with the first word put it on the map, and then you try all other words left in all positions. And so on. So you get really a damn lot of combinations, which you could delete if they break you wanted size, and in the end you might have a nice list of possibilites and show like the 10 smallest of that to choose from. My GF is away this weekend, maybe ill have a try. I think recursive could be the right way to do that.

Basically I am not getting the algorithm or you can say idea which is applicable for crosswords. In crossword, there are lot of combination's, you have to put each word in a way so that it will match with other. And also I have to show up an error if any word is different from all other. Like I have a list AUS, IND, WST, PAK, SLK and EFV. EFV is not matching with any other word. So in this case I have to show up an error for this word. Please tell me the concept or even just some code with which I can get started for this....
Prashant