Open
Conversation
…ncint to next guess
…viewBoard to displayRow. fixed Clear Row button. Added New Game button.
reneemeyer
approved these changes
Aug 31, 2017
reneemeyer
left a comment
There was a problem hiding this comment.
Craig, over all very nice job. Just a few questions below and some es6 things that you might want to fix. This is a nice starting point, the game works, it's visually appealing, so the next step in the refactoring process would be to simplify your code as much as possible and remove some of the complexity.
| this.hint = ''; | ||
| } | ||
|
|
||
| let board = { |
| } | ||
| }, // createCode() method | ||
|
|
||
| showAnswer: function() { |
| } | ||
| }, // showAnswer() method | ||
|
|
||
| populateChoice: function(selectedColor) { |
There was a problem hiding this comment.
For the users perspective, what's the point of having an initial choice?
| displayRow: function() { //, col = null, pegColor = null) { | ||
| // console.log(row, col, pegColor); | ||
| const row = this['guesses'].length-1; | ||
| console.log(row); |
| const guessCols = guessRows[row].childNodes; | ||
| console.log(guessCols); | ||
| console.log(this['guesses'][row]); | ||
| for (let i=0; i<5; i++) { |
| // Since passing arrays are by reference, when I copied my | ||
| // my guesses and code array and manipulated those copies | ||
| // it was affecting the original array. | ||
| generateHint: function(answer, guess) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Classic Mastermind game, web version.