We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please can someone says how to add a winning message after the puzzle completed? Thank you!
The text was updated successfully, but these errors were encountered:
Try this:
After the checkAnswer: function(e) ... about line 303:
Add this: (usinjg underscore _uniq function
// ADDED! check the solved array against the original puzzle data entries var uniqSolved = _.uniq(solved); console.log(uniqSolved); var numMatches = 0; var numMatchedAll = 0; for(var i=0; i < puzz.data.length; i++) { // look through all entries numMatchedAll++; for(var a=0; a < solved.length; a++) { var puzzItem = puzz.data[i]; var puzzAnswer = uniqSolved[a]; if(puzzAnswer === puzzItem.answer) { numMatches++; } } }; if(numMatches === numMatchedAll) { console.log("puzzle solved!!!!!!!"); } else { console.log("not yet ..."); }
Up to you what to do when puzzle solved
Sorry, something went wrong.
Thank you so much!
No branches or pull requests
Please can someone says how to add a winning message after the puzzle completed?
Thank you!
The text was updated successfully, but these errors were encountered: