Skip to content

Kelly Tran: Scrabble JS - #41

Open
KellyPT wants to merge 2 commits into
Ada-C6:masterfrom
KellyPT:master
Open

Kelly Tran: Scrabble JS#41
KellyPT wants to merge 2 commits into
Ada-C6:masterfrom
KellyPT:master

Conversation

@KellyPT

@KellyPT KellyPT commented Nov 23, 2016

Copy link
Copy Markdown

I did it! Yay! Thank you for the deadline extension and arranging a tutor for me! @kariabancroft @droberts-ada

Comment thread scrabble.js
highestScore = wordScore;
}
else if (highestScore === wordScore && highestWord.length !== 7 && highestWord.length > wordLen ) {
highestWord = arrayOfWords[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.

You're using the arrayOfWords[i] variable a bunch so it might be good to assign it to a variable to make the code more readable.

Comment thread scrabble.js
};

this.highestScoreFrom = function(arrayOfWords) {
var highestWord = arrayOfWords[0];

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 job using the score of the first word to ensure accurate results

Comment thread scrabble.js

// hasWon(): Function which returns true if the player has over 100 points, otherwise returns false
Player.prototype.hasWon = function() {
if (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.

Good! Note: you can use ternary operators (using the ?) in JS

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.

2 participants