-
Notifications
You must be signed in to change notification settings - Fork 50
Leaves - Alice #33
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
base: master
Are you sure you want to change the base?
Leaves - Alice #33
Conversation
@@ -1,7 +1,156 @@ | |||
const Adagrams = { | |||
drawLetters() { | |||
// Implement this method for wave 1 | |||
let letterPool = ( |
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
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 first creating an object that represents letter frequencies and then using this object to build your array.
let points = 0; | ||
|
||
for (let letter in split) { | ||
switch (split[letter]) { |
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 approach using a switch/case conditional! You probably could refactor this to use an object (a hash) though.
).split(""); | ||
let hand = []; | ||
|
||
for (let i = 0; i < 10; i++) { |
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.
You're modifying your letterPool
here. Make sure to make a deep copy first. In addition, consider how you could refactor such that you don't shuffle the pool 10 times.
JS AdagramsWhat We're Looking For
|
change npm to yarn
JS Adagrams
Congratulations! You're submitting your assignment!
Comprehension Questions