Skip to content

Sarah - #22

Open
nahmisa wants to merge 23 commits into
Ada-C6:masterfrom
nahmisa:master
Open

Sarah#22
nahmisa wants to merge 23 commits into
Ada-C6:masterfrom
nahmisa:master

Conversation

@nahmisa

@nahmisa nahmisa commented Nov 18, 2016

Copy link
Copy Markdown

I like Javascript!

Comment thread scrabble.js
score += this.letterScore[this.word[i]];
}

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

Copy link
Copy Markdown

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

Comment thread scrabble.js
} 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) {

Copy link
Copy Markdown

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

Comment thread scrabble.js
};

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

Copy link
Copy Markdown

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

Comment thread scrabble.js

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

Copy link
Copy Markdown

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