MichaelWehar / Crossword-Layout-Generator

Crossword Layout Generator - Open Source
http://michaelwehar.com/crosswords
MIT License
56 stars 17 forks source link

Words occasionally overlap #11

Open Waccsadac opened 1 year ago

Waccsadac commented 1 year ago

Occasionally two words in the same direction overlap. For example:

{
clue: 'just born',      
      answer: 'baby',
      orientation: 'down',    
      startx: 16,
      starty: 15
}

{
      clue: 'feline',
      answer: 'cat',
      orientation: 'down',
      startx: 16,
      starty: 14,
}

For some reason with these specific words it happens nearly all of the time: baby, cat, nicotine, chocolate Baby and cat consistently overlap as do nicotine and chocolate. For now I am doing manual checks to ensure this doesn't happen, but I'm stumped as to what's going on here.

I am currently generating the crosswords by selecting 5 random words from the following: baby, cat, university, nicotine, chocolate, cactus, aquarium. The two aforementioned pairs consistently overlap when they are selected regardless of the other words.