I suspect that the algorithm is wrong.

For example quantity top left, alb will only fit quantity in one place and there is only one other "a" candidate "amble". Very quickly your choices will be reduced due to placement, so 5,000 attempts seems excessive.

Sadly I have a ton of other things to do or I'd have a go myself.

Paul
----- Original Message ----- From: "Paul Steven" <paul_ste...@btinternet.com>
To: "'Flash Coders List'" <flashcoders@chattyfig.figleaf.com>
Sent: Sunday, May 31, 2009 12:17 PM
Subject: RE: [Flashcoders] Crossword generator advice


Thanks Paul

My code should backtrack in the situation you mention. So for example if it
fits tarragon on the first "t" but then continues to not be able to find a
solution with tarragon in this position, it will backtrack so that it
changes "tarragon" to the second "t". However I still can't find a solution with 16 words. There may be some other flaws in my logic preventing this. I
was wondering if in order to find a solution it will take thousands of
attempts to find a solution? I have a counter that when reaches 5000, it
breaks out of the loop trying to find the solution so I am effectively
trying 5000 combinations - perhaps there is an equation to calculate how
many combinations there are?

I would be interested if anyone else can solve this puzzle with an
alternative crossword generator?

Thanks

Paul

-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul Andrews
Sent: 31 May 2009 12:07
To: Flash Coders List
Subject: Re: [Flashcoders] Crossword generator advice

There is a flaw in your logic.

It may be that multiple words fit a given situation, and so it's necessary (with such a simple algorithm) to backtrack and look for another word to fit

once you are unable to fit another word from your list - so the real problem

is saving where you are in the list of possible combinations as you go
along.

For example, in quantity there are two "t" s, so there are two possibilities

for fitting a word. You may go with tarragon for the first "t" but in
practice it may only be possible to have a solution with tarragon as the
second "t". You must be able to backtrack your choice of tarragon as a
solution for the first "t" and go with "twin" instead. You must be able to
do this at every stage. Once you can your software should work.

Paul


----- Original Message ----- From: "Paul Steven" <paul_ste...@btinternet.com>
To: "'Flash Coders List'" <flashcoders@chattyfig.figleaf.com>
Sent: Sunday, May 31, 2009 10:09 AM
Subject: RE: [Flashcoders] Crossword generator advice


Just to add more information to how I am currently trying to achieve this.

I basically start with the first word in the list and place it in the top
left position 0,0. I then attempt to add the next word in the list by
finding a character in the first word that is the same as one of the
characters in this new word. If it fails to add this next word, it puts
this
word to the back of the list and tries the next word. If at any point, it
is
no longer able to add one of the remaining unplaced words, it back tracks
and changes the previously added word to a different one. So in theory it
should attempt to find a solution by trying every single word in the top
left 0,0 position, then attempting to add the others where they can fit.
The
complete crossword solution has the word "Quantity" in the top left going
across so in theory a solution should be possible with this word at this
position and this orientation.

Hopefully someone can shed some light on a solution.

Many thanks

Paul

-----Original Message-----
From: flashcoders-boun...@chattyfig.figleaf.com
[mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Paul
Steven
Sent: 31 May 2009 10:02
To: 'Flash Coders List'
Subject: [Flashcoders] Crossword generator advice

I am creating a crossword generator where you can enter the size of the
grid
and a list of words but for the life of me cannot get it to generate a
puzzle with all the words in my list. This list of words is from a
crossword
that I know is possible. Now either my generator is not up to scratch or
the
process of creating a crossword is very complex and will require so many
iterations that it would take a long time to work out a solution.

Here is the list of words I am trying to generate the crossword with. The
size of the grid is 9 x 9. I have tried several online crossword
generators
and none of them are able to generate a puzzle of this size with these
words. The most words I have been able to generate a puzzle with is 11
words. However I know for a fact it is possible as I have an actual
crossword with these 16 words. I would therefore appreciate any advice.
Perhaps someone has a crossword generator they can try these 16 words in?

quantity
alb
iliad
epee
jinx
glass
inn
tarragon
quake
amble
twin
yearn
pilot
icing
xenon
user

Thanks in advance

Paul

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to