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

Nina Mutty - Scrabble #30

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

Nina Mutty - Scrabble #30

wants to merge 4 commits into from

Conversation

ninamutty
Copy link

Baseline complete and tilebag drawTiles method complete

Copy link

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work Nina,

I put a few comments in here, but very well done.

// Put all of this in prototype
Player.prototype = {
play: function(add) {
return this.plays.push(add);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about if the player has already won?

Check requirements.

totalScore: function() {
total = 0;
scrabble = new Scrabble();
for(var i=0; i < this.plays.length; i++) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't there be some vars in these variable declarations?

highestWordScore: function() {
scrabble = new Scrabble();
return scrabble.score(scrabble.highestScoreFrom(this.plays));
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good use of existing functions.

totalScore += 8;
} else if (this.POINT_LIST[6].includes(word[i])) {
totalScore += 10;
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, so this just skips anything that's not a letter.

console.log(s.highestScoreFrom(["aaaaad", "aaaaaaa"])); // 'aaaaaaa'
console.log(s.score(""));
console.log("Cat: " + s.score("cat"));
console.log(s.highestScoreFrom(["", ""]));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work testing things.

for (var i=0; i < num; i++) {
randomNumber = Math.floor(Math.random() * this.tiles.length);
pulledTiles.push(this.tiles.splice(randomNumber, 1)[0]);
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good use of push and slice to take letters out of the tilebag and put them into pulledTiles.

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