-
Notifications
You must be signed in to change notification settings - Fork 44
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
Nina Mutty - Scrabble #30
base: master
Are you sure you want to change the base?
Conversation
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 work Nina,
I put a few comments in here, but very well done.
// Put all of this in prototype | ||
Player.prototype = { | ||
play: function(add) { | ||
return this.plays.push(add); |
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.
What about if the player has already won?
Check requirements.
totalScore: function() { | ||
total = 0; | ||
scrabble = new Scrabble(); | ||
for(var i=0; i < this.plays.length; 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.
Shouldn't there be some vars in these variable declarations?
highestWordScore: function() { | ||
scrabble = new Scrabble(); | ||
return scrabble.score(scrabble.highestScoreFrom(this.plays)); | ||
} |
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.
Good use of existing functions.
totalScore += 8; | ||
} else if (this.POINT_LIST[6].includes(word[i])) { | ||
totalScore += 10; | ||
}; |
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.
Interesting, so this just skips anything that's not a letter.
console.log(s.highestScoreFrom(["aaaaad", "aaaaaaa"])); // 'aaaaaaa' | ||
console.log(s.score("")); | ||
console.log("Cat: " + s.score("cat")); | ||
console.log(s.highestScoreFrom(["", ""])); |
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.
Good work testing things.
for (var i=0; i < num; i++) { | ||
randomNumber = Math.floor(Math.random() * this.tiles.length); | ||
pulledTiles.push(this.tiles.splice(randomNumber, 1)[0]); | ||
} |
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.
Good use of push and slice to take letters out of the tilebag and put them into pulledTiles
.
Baseline complete and tilebag drawTiles method complete