Skip to content

Conversation

@copelandhouse2
Copy link
Owner

The Classic Mastermind game, web version.

Copy link

@reneemeyer reneemeyer left a 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 = {

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() {

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

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

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++) {

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants