-
Notifications
You must be signed in to change notification settings - Fork 50
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
Leaves - Cloudy #47
base: master
Are you sure you want to change the base?
Leaves - Cloudy #47
Conversation
…got very lost in the syntax and what i thought wasnt working at all was working all along
JS AdagramsWhat We're Looking For
|
const Adagrams = { | ||
drawLetters() { | ||
// Implement this method for wave 1 | ||
let allLetters = { |
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 should be a const
.
Style note: put each letter on it's own line.
let allLetters = { | ||
A: 9, N: 6, B: 2, O: 8, C: 2, P: 2, D: 4, Q: 1, E: 12, R: 6, F: 2, S: 4, G: 3, T: 6, H: 2, U: 4, I: 9, V: 2, J: 1, W: 2, K: 1, X: 1, L: 4, Y: 2, M: 2, Z: 1 }; | ||
|
||
let letterScores = { |
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 should be a const
.
Style note: put each letter on it's own line.
allLetters
and letterScores
are best placed inside the module, but above all the functions.
const myHand = []; | ||
|
||
for(let i = 0; i < 10; i += 1) { | ||
const myShuffledLetters = Math.floor(Math.random(letters) * (letters.length)); |
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.
Walk through what this line of code is doing. Math.random()
shouldn't take an argument.
myShuffledLetters
should have a more semantically correct name.
There is a small bug where this could would allow you to pick 10 Z's (for instance), even though there aren't 10 Z's. What chance is necessary?
}); | ||
if (word.length >= 7) { | ||
return thisTotal + 8; | ||
} else { |
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 else
block isn't necessary.
JS Adagrams
Congratulations! You're submitting your assignment!
Comprehension Questions