Coder Social home page Coder Social logo

wordfind's People

Contributors

aarti avatar billscheidel avatar bunkat avatar lucas-c avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wordfind's Issues

preferOverlap not working as expected.

Hello, I've set preferOverlap to false, within the wordfind.js file but its still overlapping when generating the wordsearch, am I missing something or am I suppose to put preferOverlap somewhere else?

Issue in Touch events

file: wordfindgame.js
function: touchMove, line107
problem: the touch events do not register on the grid
fix: change var targetElement = document.elementFromPoint(xPos, yPos); select(targetElement) TO select(document.elementFromPoint(xPos, yPos)); Because variable targetElement is giving null.

Solve display does not work if your html page contains some classes labelled as '.' + word to find

The solve display need to find all the buttons created with an automated created class with the text to find. So, if your page uses this class to display some elements that are not in the puzzle, thoses elements will get the "wordFound" class.

The first time you solves the puzzle everything is good. but if you want to dynamically rgenerate another puzzle, without reloading your html page, then the solve script does not word anymore on the texte to find, which correspond to the className.

I've changed in wordfindgame.js the solve script in order to set the class "wordFound" only into the div containing te puzzle, whatever this div id can be. here is the code :

` solve: function(puzzle, words) {

            var solution = wordfind.solve(puzzle, words).found;

            // recherche l'element qui contient le puzzle
            var elem_puzzle = $('[x="0"][y="0"]').parent().parent().attr('id')
          
            for (var i = 0, len = solution.length; i < len; i++) {

                var word = solution[i].word,
                    orientation = solution[i].orientation,
                    x = solution[i].x,
                    y = solution[i].y,
                    next = wordfind.orientations[orientation];

                if (!$('#'+elem_puzzle + '.' + word).hasClass('wordFound')) {
                  
                    for (var j = 0, size = word.length; j < size; j++) {
                        var nextPos = next(x, y, j);
                        $('[x="' + nextPos.x + '"][y="' + nextPos.y + '"]').addClass('solved');
                    }

                    $('#'+ elem_puzzle +' .' + word).addClass('wordFound');
                    
                }
            }

        },

Hope it helps`everybody

Not Working

I am trying to demo this but it is not letting me find a word when I drag. Any idea as to whats going on?

Is this browser specific? or should it work on all browsers?

Restore original README

Hi.

Because I made the mistake of adding some extra commits on my fork branch used in PR #12 before you merged it, your original README has been replaced by mine :(

Sorry about that. Restoring the previous version should only be a matter of: git reset --hard HEAD^^^^^^ README.md

My name has also been added index.html: feel free to remove it.

Prefer diagonal?

Wondering if there is way to indicate the preference of having a diagonal (or any other) direction?

Orientations not working

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);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.