Skip to content
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

Sarah #22

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open

Sarah #22

wants to merge 23 commits into from

Conversation

nahmisa
Copy link

@nahmisa nahmisa commented Nov 18, 2016

I like Javascript!

score += this.letterScore[this.word[i]];
}

if (this.word.length >= this.maxLength) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might argue that the greater than case would be an error rather than the bonus

} else if (score == highScore) {
// if the top score is tied between multiple words,
// pick the one with the fewest letters.
if (word.length < highScoreWord.length) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would make more sense to add this to the else if above with an && rather than having another if inside

};

Player.prototype.hasWon = function() {
return this.totalScore() > 100;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice use of the inline conditional


Player.prototype.removeTiles = function(word) {
this.word = word;
for(var i=0; i<this.word.length; i++) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Watch your spacing here, it is more pleasing to add spaces between the = and the < for the for loop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants