Skip to content

JS Scrabble - Emilce - Octos#25

Open
emilcecarlisa wants to merge 11 commits into
Ada-C9:masterfrom
emilcecarlisa:master
Open

JS Scrabble - Emilce - Octos#25
emilcecarlisa wants to merge 11 commits into
Ada-C9:masterfrom
emilcecarlisa:master

Conversation

@emilcecarlisa

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? The conditionals and looping concepts were similar. Class and object structures were different enough to cause some confusion at first.
What was a challenge you faced in this assignment? I struggled with some of the game logic when I tried to think of it on my own, then I decided to look at the Ruby implementation.
Do you have any recommendations on how we could improve this project for the next cohort? I really liked all the in class examples/ mini lessons.

@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 for you to review, but in general this is a solid submission.

Comment thread scrabble.js
const scoringRubrik = {
'a': 1,
'e': 1,
'i': 1,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I like this hash structure here.

Comment thread scrabble.js
score(w) {
if (w == "" || w == null || typeof(w) !== 'string') {
throw 'Must provide a sentence with valid characters'
}

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
switch(true) {
case (word.length == 7):
return wordScore + 50;
case (word.length == 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.

I'm surprised (and a little impressed) that this works. However, stylistically it's hard to read, since this doesn't really match what a switch is meant to be used for. A regular if statement would probably be more clear.

Comment thread scrabble.js
breakTie(incumbent, challenger) {
if (incumbent.length == 7) {
return incumbent;
} else if (challenger.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 method to simplify this logic.

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