-
Notifications
You must be signed in to change notification settings - Fork 0
Visual Mastermind (Checkpoint 2) #11
New issue
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
base: gh-pages
Are you sure you want to change the base?
Conversation
…ncint to next guess
…viewBoard to displayRow. fixed Clear Row button. Added New Game button.
reneemeyer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this a let and not a const?
| } | ||
| }, // createCode() method | ||
|
|
||
| showAnswer: function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for this :)
| } | ||
| }, // showAnswer() method | ||
|
|
||
| populateChoice: function(selectedColor) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job console.logging!!
| const guessCols = guessRows[row].childNodes; | ||
| console.log(guessCols); | ||
| console.log(this['guesses'][row]); | ||
| for (let i=0; i<5; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you use a for loop here?
| // 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) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these should be es6 functions
The Classic Mastermind game, web version.