Skip to content

Comments

JS Scrabble - Octos- Cara Brennan#22

Open
MississippiBrenn wants to merge 2 commits intoAda-C9:masterfrom
MississippiBrenn:master
Open

JS Scrabble - Octos- Cara Brennan#22
MississippiBrenn wants to merge 2 commits intoAda-C9:masterfrom
MississippiBrenn:master

Conversation

@MississippiBrenn
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? Most of the patterns were translatable to Java, loops and method calls were reused, as was a lot of the business logic.
What was a challenge you faced in this assignment? In this assignment I was confused about the nature of the instantiation at first. It took some time to stop trying to loosely couple the module from a class, and see that I thought they were two classes. There were different syntax for the tests as well, especially throwing on an empty array was complicated and took a minute.
Do you have any recommendations on how we could improve this project for the next cohort? Overall I thought it was an attainable project, and it had many solutions for problems I faced within the program itself.

@droberts-sea
Copy link

JS Scrabble

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene no - I would like to see much more frequent commits, with more descriptive commit messages.
Comprehension questions yes - JavaScript, not Java :)
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 comments inline for you to review, but in general this is a solid submission.

const SCORING_RUBRIK = {
'a': 1,
'e': 1,
'i': 1,

Choose a reason for hiding this comment

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

I like the use of a hash to store this information - good instincts! However, defining it inside the method ends up being a little cumbersome. Putting it at the top of the file might be a little more readable.

if (!RegExp(/^[a-zA-Z]+$/).test(letter)){

throw `Letters only please. Letter: ${letter} i == ${i} word: ${word}`
}

Choose a reason for hiding this comment

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

It would be a little faster to test this regular expression against the whole word outside the loop.

highestWordScoreWord(arrayOfWords) {
let highWord = ''
let highScore = -1
if (arrayOfWords.length === 0){

Choose a reason for hiding this comment

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

You've got almost exactly the same logic duplicated between here and highestScoreFrom. Could you DRY these up somehow?

tiebreaker(challenger, incumbent){
if (incumbent.length === 7){
return incumbent;
}else if (challenger.length === 7){

Choose a reason for hiding this comment

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

I like the use of a helper method to clarify 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