src/lib/wordfindgame.js
function (square) {
            // make sure we are still forming a valid word
            for (var i = 0, len = wordList.length; i < len; i++) {
                if (wordList[i].indexOf(curWord + $(square).text()) === 0) {
                    $(square).addClass('selected');
                    selectedSquares.push(square);
                    curWord += $(square).text();
                    break;
                }
            }
        }
function (square) {
            // make sure we are still forming a valid word
            for (var i = 0, len = wordList.length; i < len; i++) {
                if (wordList[i].indexOf(curWord + $(square).text()) === 0) {
                    $(square).addClass('selected');
                    selectedSquares.push(square);
                    curWord += $(square).text();
                    break;
                }
            }
        }
function ( square ) { // make sure we are still forming a valid word for ( var i = 0 , len = wordList . length ; i < len ; i ++ ) { if ( wordList [ i ] . indexOf ( curWord + $ ( square ) . text ( ) ) === 0 ) { $ ( square ) . addClass ( 'selected' ) ; selectedSquares . push ( square ) ; curWord += $ ( square ) . text ( ) ; break ; } } }
Updates the game state when the previous selection was valid.

@param {el} square: The jQuery element that was played
Updates the game state when the previous selection was valid .