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

Ana Lisa Sutherland - Octos C9- JS Scrabble #38

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

Conversation

The-Beez-Kneez
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?
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

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.

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,

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.

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

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

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) {

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