Off the top of my head..
For a horizontal overlap of a word, the new word can only be placed in a
very few places - no further left than the leftmost position of the
wordlaready placed and no further right than the new word can be placed
without going off the grid, or not overlapping the rightmost position of
the placed word. Similarly for vertical positions. This drastically
reduces your placement options.
for a connected only crossword, the overlap must be as above and for
every placed word where an overlap occurs, characters must match with
the new word where they overlap.
Essentially we have:
For each already placed word
if new word can overlap
try placement for valid positions of new world
for each placement compare overlap charaters for equality.
Maybe this should now be off-list - it has nothing to do with flash!
Paul
Paul Steven wrote:
Thanks Paul for your reply.
You may be right about my placement checker. What I currently do is as
follows:
Starting with first char of word I want to place, loop through the
characters of each word that is already on the puzzle and see if a match can
be found. If a match is found then I calculate where the new word would
appear on the grid based on crossing the existing word where they characters
match.
I then check if there are any words in the way or the new word goes off the
grid.
I also check that the new word is not adjacent to another word
My code does not allow words to be added unless they cross another word so
perhaps allowing disconnected placement would speed things up. I will give
it a try.
Thanks again for your help on this.
Paul
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders