Skip to content

JS Scrabble - Angela - Octos#44

Open
knockknockhusthere wants to merge 12 commits into
Ada-C9:masterfrom
knockknockhusthere:master
Open

JS Scrabble - Angela - Octos#44
knockknockhusthere wants to merge 12 commits into
Ada-C9:masterfrom
knockknockhusthere:master

Conversation

@knockknockhusthere

Copy link
Copy Markdown

JS Scrabble

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
What patterns were you able to use from your Ruby knowledge to apply to JavaScript? It actually felt pretty different. Knowing conditionals and loops and basic logic was helpful.
What was a challenge you faced in this assignment? It was mostly syntax, or calling this/Module name with a function took awhile to understand.
Do you have any recommendations on how we could improve this project for the next cohort? Not really. It was pretty straightforward

@droberts-sea

Copy link
Copy Markdown

JS Scrabble

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene yes
Comprehension questions yes
General
score calculates score, has appropriate params and return value yes
highestScoreFrom calculates highest scoring word, has appropriate params and return value yes
Player object
Has name and plays properties yes
Has play, totalScore, hasWon functions yes
Has highestScoringWord and highestWordScore functions yes
Overall Good work overall! I've left some inline comments that you should review, but in general this is a solid submission.

Comment thread scrabble.js
{
"a": { "points": 1, "tiles": 9 },
"b": { "points": 3, "tiles": 2 },
"c": { "points": 3, "tiles": 2 },

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 tying together point values and tile counts in one data structure - very clever.

Comment thread scrabble.js
if (!word.match(/^[a-zA-Z]+$/)) {
throw "Not a valid word";
} else if (word.length === 0) {
throw "No word given";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Instead of throwing a string, you should throw an instance of Error. That gives you access to stack trace information. Something like this:

if (condition) {
  throw new Error(`Invalid word ${word}`);
}

Comment thread scrabble.js
breakTie(topWord, word) {
if ( topWord.length === 7 ) {
return topWord;
} else if (word.length === 7) {

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 a helper function to clarify this logic.

Comment thread scrabble.js
highestScoringWord() {
if (this.plays.length === 0) {
throw "No words played";
}

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 should be reusing the scoring logic from highestScoreFrom here.

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