-
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
Sarah #22
base: master
Are you sure you want to change the base?
Sarah #22
Conversation
score += this.letterScore[this.word[i]]; | ||
} | ||
|
||
if (this.word.length >= this.maxLength) { |
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.
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) { |
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.
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; |
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 use of the inline conditional
|
||
Player.prototype.removeTiles = function(word) { | ||
this.word = word; | ||
for(var i=0; i<this.word.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.
Watch your spacing here, it is more pleasing to add spaces between the =
and the <
for the for loop
I like Javascript!