-
Notifications
You must be signed in to change notification settings - Fork 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
Leaves - Hallie and Georgina: Adagrams #12
base: master
Are you sure you want to change the base?
Conversation
…o not have to use all letters).
AdagramsWhat We're Looking For
|
end | ||
|
||
array_letters = array_letters.join("") | ||
array_letters = array_letters.split('') |
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 is weird. What are you trying to achieve here? It needs a comment.
# Hash from hand - quantity of individual letters | ||
letters_in_hand.each do |character| | ||
hand_hash[character] += 1 | ||
end |
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.
Once you have this hash, do you need a second one? Or can you just iterate through the input and reduce the values on the hand_hash
?
|
||
# Look up each character for score value | ||
word.each do |character| | ||
score += values_by_letter[character.to_sym] |
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.
Nice!
high_score_hash[:word] = highest_score[0] | ||
high_score_hash[:score] = highest_score[1] | ||
|
||
# TIES |
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.
Love the labelling.
Adagrams
Congratulations! You're submitting your assignment.
Comprehension Questions
Enumerable
mixin? If so, where and why was it helpful?