-
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
Fire - Noor and Anna #17
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.
Overall not bad. You hit the main learning goals here. However check out my comments on highest_score_from
. I'm not convinced it works in all cases.
.floo | ||
.flooignore |
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.
Smart!
@@ -0,0 +1,129 @@ | |||
|
|||
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.
Nice way to set up the distribution of letters.
} | ||
|
||
# WAVE 1 | ||
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.
👍
|
||
# 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.
👍
|
||
# 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.
👍
return hash | ||
elsif length < 10 | ||
min_length = word_lengths.min | ||
hash[:word] = words[word_lengths.index(min_length)] |
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 might not work in all cases. What if there is a non-winning word with an equal length
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.
Ah I see! Because we are checking through all the words that are passed as an argument, when we should be looking at the subset that has the highest points - is that right?
hash[:word] = words[word_lengths.index(length)] | ||
hash[:score] = points[word_lengths.index(length)] | ||
return hash |
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 don't know if the word with length 10 is tied for the highest score here.
|
||
# 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.
I am uncertain that this method will work in all cases. See my comments below.
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?