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

Yordanos Dirar: JS-Scrabble #17

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

Conversation

yordanosd
Copy link

Added request as a dependency.

Thank you for taking time to review my code.

Yordanos

Scrabble.prototype.highestScoreFrom = function(arrayOfWords){

var maxWord = [arrayOfWords[0], this.score(arrayOfWords[0])];
var currentScore = this.score(arrayOfWords[0]);
Copy link

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

Copy link
Author

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
.

@jbuechs
Copy link

jbuechs commented Jun 16, 2016

Overall great job! Most of my comments are nitpicks - hope you don't mind but there wasn't much big stuff to comment on. 😀

@yordanosd
Copy link
Author

Thank you so much for taking the time to review my code. I really
appreciate the feedback. Love the nitpicks. It only helps to make me a
better programmer =)

On Wed, Jun 15, 2016 at 9:56 PM, Jennie Buechner [email protected]
wrote:

Overall great job! Most of my comments are nitpicks - hope you don't mind
but there wasn't much big stuff to comment on. 😀


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#17 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AOaZbd2yJXqUOv7WVNNHuu71_aeeOnzpks5qMNeXgaJpZM4Iz-uw
.

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

Successfully merging this pull request may close these issues.

2 participants