Branches - Julia & Eve#14
Conversation
Edited word in a comment
AdagramsWhat We're Looking For
Eve and Julia!! You two have a fantastic solution! I see a lot of thought put into your submission; you all achieved not only a good, logical, readable solution, but it has obviously gone through refactoring to make it as clever and elegant as possible within this time. Some of the only things I could think of for improvement on this submission would be to add in the unit tests for the optional wave 5, and practice using more descriptive commit messages. Otherwise, please keep up the clarity in logic and code, and maintain the refactoring when you can. Great work on this submission! |
| drawn_letters = [] | ||
| 10.times do | ||
| letters.shuffle! | ||
| drawn_letters << letters.pop |
There was a problem hiding this comment.
Nice! Using .pop here is concise and a good call
| characters.each do |char| | ||
| index = current_letters_in_hand.find_index(char) | ||
| # if index number is truthy, delete element at index | ||
| if index |
There was a problem hiding this comment.
Nice logic here that relies on truthiness and understanding what find_index does!
| current_letters_in_hand.delete_at(index) | ||
| # if index number is falsey, return false | ||
| else | ||
| return false |
There was a problem hiding this comment.
Nice logic; putting a return false here will break the method out as soon as it needs to
| winner = winner.empty? ? high_scores.min_by { |element| element.length } : winner[0] | ||
|
|
||
| return { word: winner, score: best_result[:score] } | ||
| end |
There was a problem hiding this comment.
I'm obsessed with y'alls implementation of this method! It's so clever and so concise! It looks so good! The only thought for improvement is maybe using a different variable name besides obj. Otherwise, I love how it reads!
|
|
||
| # WAVE 5 | ||
|
|
||
| def is_in_english_dict?(input) |
There was a problem hiding this comment.
Great work on the optional! :D ...Tests? ;)
Adagrams
Congratulations! You're submitting your assignment.
Comprehension Questions
Enumerablemixin? If so, where and why was it helpful?