bunkat / wordfind

A small javascript library for generating and solving word find (also known as word search) puzzles.
MIT License
196 stars 111 forks source link

Orientations not working #10

Closed luizhop closed 7 years ago

luizhop commented 7 years ago

Hi,

The orientations parameter is not working for me. I have tried to set only horizontal and both horizontal and vertical, but in both cases the words are spread using other options (horizontalBack, verticalUp, diagonal, etc).

Thanks,


UPDATE [Problem solved]

I was declaring two different things (the wordfind and the puzzle) and setting the properties at the wrong place: var gamePuzzle = wordfindgame.create(words, '#puzzle', '#words'); var puzzle = wordfind.newPuzzle(words, { orientations: ['horizontal', 'vertical'] });

So I took a look inside the .js files and found out that only declaring wordfindgame.create will do all the job, so it worked when I changed to: var puzzleOptions = { orientations: ['horizontal', 'vertical'] }; var gamePuzzle = wordfindgame.create(words, '#puzzle', '#words', puzzleOptions);