-
Notifications
You must be signed in to change notification settings - Fork 27
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
SHERMAN and FAHMY Adagrams #6
base: master
Are you sure you want to change the base?
Conversation
AdagramsWhat We're Looking For
|
|
||
def highest_score_from(words) | ||
best_word = {word: nil, score: 0} | ||
words.each do |word| |
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.
ONE LOOP I LOVE IT
new_letters = letter_in_hand.map { |i| i } | ||
input.split("").each do |letter| | ||
if !new_letters.include? letter | ||
return false |
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 job returning when you know the outcome!
tiles_drawn = 0 | ||
until tiles_drawn == 10 | ||
letter = alphabet.keys.sample | ||
if alphabet[letter] > 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.
Using a hash with sample gives an equal 1/26 chance to each letter, instead we need the chances to be weighted.
Adagrams
Congratulations! You're submitting your assignment.
Comprehension Questions
Enumerable
mixin? If so, where and why was it helpful?