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

JS Scrabble - Angela - Octos #44

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

Conversation

knockknockhusthere
Copy link

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

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.

{
"a": { "points": 1, "tiles": 9 },
"b": { "points": 3, "tiles": 2 },
"c": { "points": 3, "tiles": 2 },

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.

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

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}`);
}

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

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.

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

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