-
Notifications
You must be signed in to change notification settings - Fork 36
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
Adagrams submission from Mona and Tram #12
base: master
Are you sure you want to change the base?
Conversation
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.
Well done Mona & Tram, y'all hit the learning goals here. Well done.
# create draw_letters method | ||
def draw_letters |
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.
👍 , very straightforward and effective.
return hand_of_letters.sample(10) | ||
end | ||
|
||
def uses_available_letters?(input, letters_in_hand) |
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.
👍
def score_word(word) | ||
letters_and_value = { |
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 the use of a hash here!
return {word: word, score: score_word(word)} if word.length == 10 | ||
end | ||
|
||
return words_and_scores_array.select {|hash| hash[:score] == max_score}.sort_by{|hash| hash[:word].length}[0] |
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.
Really clever way to get the smallest of the highest scoring words.
return score | ||
end | ||
|
||
def highest_score_from(words) |
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.
👍
Assignment Submission: Adagrams
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection
Enumerable
mixin? If so, where and why was it helpful?