-
Notifications
You must be signed in to change notification settings - Fork 36
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
Olivia's JS-Scrabble #17
base: master
Are you sure you want to change the base?
Conversation
…is. added word scoring method and pointValue
… Removed properties from srabble constructor, added prototype back in, included both functions in the prototype.
//iterate over plays | ||
this.plays.forEach(function(word)) { | ||
this.plays[i] += this.plays[i]; | ||
Math.sum(this.plays[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.
Should this be totalScore += playScrabble.score(word);
JS ScrabbleWhat We're Looking For
|
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.
Some things to look at here.
for (var i = 0; i < word.length; i++) { | ||
points += pointValue[word[i]]; | ||
} | ||
if (word.length > 6) |
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.
The end of this function should probably go from:
if (word.length > 6)
var wordscore = word.score + 50;
};
return wordscore;
}
To:
if (word.length > 6)
points += 50;
return points;
};
|
||
Player.prototype.highestWordScore = function() { | ||
var highestWordScore = 0 | ||
for (var i = 0; i < wordsPlayed.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.
You can call highestScoringWord
and use Scrabble.score
in this method instead of the loop.
JS Scrabble
Congratulations! You're submitting your assignment!
Comprehension Questions