Ana Lisa Sutherland - Octos C9- JS Scrabble#38
Open
The-Beez-Kneez wants to merge 10 commits into
Open
Conversation
…r and lower case conditions
…ayer class and associated tests tomorrow morning
JS ScrabbleWhat We're Looking For
|
| 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, |
There was a problem hiding this comment.
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.'; | ||
| } |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
Good use of a helper function to clarify this logic.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JS Scrabble
Congratulations! You're submitting your assignment!
Comprehension Questions
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.