-
Notifications
You must be signed in to change notification settings - Fork 44
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
Briana Eng - Scrabble #29
base: master
Are you sure you want to change the base?
Conversation
…ostly calling the other functions incorrectly). Seems to work decently right now, need to check again.
…unctions were called (in both).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall nice job Briana. I like in particular how you used a Javascript object as essentially a Hash to score words.
I did put a comment here about an overly complicated method. Think about how you can simplify it a bit. I think I remember your Ruby Scrabble being similarly complicated.
return 'hello world!'; | ||
var Scrabble = function() { | ||
this.score = function(word) { | ||
var cases = {A: 1, E: 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, F: 4, H: 4, V: 4, W: 4, Y: 4, K: 5, J: 8, X: 8, Q: 10, Z: 10}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good use of a JavaScript object as a Hash, exactly as I did it!
} | ||
|
||
return winningWord; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems a little complicated. Couldn't you just use 1 loop with an if statement inside?
console.log("Should print z - same score, shorter word"); | ||
var bestWord2 = anotherGame.highestScoreFrom(["z", "kk"]); | ||
console.log(bestWord2); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work testing the functions.
@@ -0,0 +1,126 @@ | |||
//WAVE 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why separate file for prototypes?
No description provided.