Skip to content

Nina Mutty - Scrabble - #30

Open
ninamutty wants to merge 4 commits into
Ada-C6:masterfrom
ninamutty:master
Open

Nina Mutty - Scrabble#30
ninamutty wants to merge 4 commits into
Ada-C6:masterfrom
ninamutty:master

Conversation

@ninamutty

Copy link
Copy Markdown

Baseline complete and tilebag drawTiles method complete

@CheezItMan CheezItMan left a comment

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 work Nina,

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

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

Copy link
Copy Markdown

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.

Comment thread player.js
totalScore: function() {
total = 0;
scrabble = new Scrabble();
for(var i=0; i < this.plays.length; 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.

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

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

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 use of existing functions.

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

Copy link
Copy Markdown

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.

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

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 work testing things.

Comment thread tilebag.js
for (var i=0; i < num; i++) {
randomNumber = Math.floor(Math.random() * this.tiles.length);
pulledTiles.push(this.tiles.splice(randomNumber, 1)[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.

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