Skip to content

Ana Lisa Sutherland - Octos C9- JS Scrabble#38

Open
The-Beez-Kneez wants to merge 10 commits into
Ada-C9:masterfrom
The-Beez-Kneez:master
Open

Ana Lisa Sutherland - Octos C9- JS Scrabble#38
The-Beez-Kneez wants to merge 10 commits into
Ada-C9:masterfrom
The-Beez-Kneez:master

Conversation

@The-Beez-Kneez

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 it test blocks were easily replicated over into JS, just a lil bit different parts. The overall layout was the same.

What was a challenge you faced in this assignment? |
I had some issues debugging and remembering the differences in functions and classes, creating and passing functions was something I kept mixing up. I then spent more time trying to decide how to proceed then I thin was necessary.

Do you have any recommendations on how we could improve this project for the next cohort? |
Maybe publically repost the instructor implementation w/tests from Ruby, that would have helped tremendously when I got stuck on test writing. It would have been at least good to see what to test again, and also would have unstuck me when I was building the highestScoreFrom function in Wave 1.

@droberts-sea

Copy link
Copy Markdown

JS Scrabble

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene yes
Comprehension questions yes - please don't add newlines to the PR comprehension questions, it breaks the table formatting.
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 a few inline comments below, but in general this is a solid submission.

Comment thread scrabble.js
scoreBoard: {
'A': 1, 'E': 1, 'I': 1, 'O': 1, 'U': 1, 'L': 1, 'N': 1, 'R': 1, 'S': 1, 'T': 1,
'D': 2, 'G': 2,
'B': 3, 'C': 3, 'M': 3, 'P': 3,

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 the use of a hash to store this info.

Comment thread scrabble.js
//throws if word is longer then 7 characters
if (word.search(/[^a-zA-Z]+/) !== -1 || word.length === 0 || word.length > 7) {
throw 'Invalid word.';
}

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
const tieBreak = function tieBreak(best_word, challenger_word) {
console.log(`Best Word: ${best_word}`);
console.log(`Challenger Word: ${challenger_word}`);
if (best_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.

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