-
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 - Dominique #37
base: master
Are you sure you want to change the base?
Conversation
JS AdagramsWhat We're Looking For
|
drawLetters() { | ||
// Implement this method for wave 1 | ||
const rawTiles = { |
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.
Style wise - I recommend putting the object outside of the drawLetters()
function (but inside the module).
|
||
|
||
scoreWord(word) { | ||
const scoreChart = { |
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.
Style wise - I recommend putting the object scoreChart
outside of the scoreWod()
function (but inside the module).
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.
Style note: You should create this object the same way you did for rawTiles
:
const scoreChart = { A: 1, B: 3 ... }
} | ||
} | ||
|
||
input.split('').forEach(checkForLetter); |
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.
Consider whether there's a different type of for loop that you could use that would allow you to break out of the loop as soon as you encounter false
.
|
||
const letterPool = []; | ||
|
||
for(const key in rawTiles) { |
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.
I really like that you store the letter frequencies and then build the pool - this is much easier to read than a giant array full of 9 'A's, 2 'B's, etc.
|
||
let i = 0; | ||
|
||
while ( i <= 9) { |
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.
It looks like you could get the same letter twice because there's nothing keeping the random number from being repeated. Consider how you could address this.
JS Adagrams
Congratulations! You're submitting your assignment!
Comprehension Questions