-
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
Ayesha and Ren's Adagrams project submission #7
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.
Nice work Ayesha & Ren, you hit all the learning goals here including the optional dictionary methods. Well done. Take a look at my comments especially about draw_letters
and let me know what questions you have.
until ten_strings_array.length == 10 | ||
rand_letter = letters_pool_keys[rand(letters_pool_keys.size)] | ||
if (letters_pool_to_draw_from[rand_letter]).zero? | ||
next | ||
else |
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 runs, but it gives an equal probability of drawing a Z
and an E
.
A better strategy would be to use your hash to build an array of all the letters with 9 As, 2 Bs etc , shuffle the array and then draw the right number of letters.
# WAVE 2 | ||
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.
👍
end | ||
|
||
# Wave 3 | ||
def score_word(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.
👍 , This works well.
# Wave 4 | ||
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.
👍
end | ||
end | ||
end | ||
max_pair |
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.
max_pair | |
return max_pair |
# Wave 5 | ||
def is_in_english_dict?(input) |
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 work with the optional.
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?