-
Notifications
You must be signed in to change notification settings - Fork 24
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
Yordanos Dirar: JS-Scrabble #17
base: master
Are you sure you want to change the base?
Conversation
…on and passed tests associated with the named functions
…s a json request to API to check if word if valid
Scrabble.prototype.highestScoreFrom = function(arrayOfWords){ | ||
|
||
var maxWord = [arrayOfWords[0], this.score(arrayOfWords[0])]; | ||
var currentScore = this.score(arrayOfWords[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.
Nitpick - It's not efficient to call the score function twice on the same word.
Could just do currentScore = maxWord[1]
for example
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.
Right! That's the benefit of maxWord.
On Wed, Jun 15, 2016 at 9:32 PM, Jennie Buechner [email protected]
wrote:
In scrabble.js
#17 (comment):
- for(var char of wordArray){
score += this._points[char];
tiles += 1;
- };
- if(tiles == 7){
score += 50;
- };
- return score;
- };
- Scrabble.prototype.highestScoreFrom = function(arrayOfWords){
- var maxWord = [arrayOfWords[0], this.score(arrayOfWords[0])];
- var currentScore = this.score(arrayOfWords[0]);
Nitpick - It's not efficient to call the score function twice on the same
word.Could just do currentScore = maxWord[1] for example
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/Ada-C5/js-scrabble/pull/17/files/68f6a6ae8a0ccd97a9fe4f3a205163ad6eefb2ee#r67286124,
or mute the thread
https://github.com/notifications/unsubscribe/AOaZbfd5y9-7Or8snk-oqvTUn3kRFZ_Xks5qMNHsgaJpZM4Iz-uw
.
Overall great job! Most of my comments are nitpicks - hope you don't mind but there wasn't much big stuff to comment on. 😀 |
Thank you so much for taking the time to review my code. I really On Wed, Jun 15, 2016 at 9:56 PM, Jennie Buechner [email protected]
|
Added request as a dependency.
Thank you for taking time to review my code.
Yordanos