Conversation
AdagramsWhat We're Looking For
Well done on this project, Brianna and Monick! You all have some great and solid logic, with readable code style. I can tell that you all wrote your solution and found interesting and awesome opportunities to use Enumerable methods. I have a few comments on your code to help point out some places where I think things could be cleaned up if you had more time on this project. I could also see a lot opportunities of refactoring the Otherwise, great work on this project. |
| end | ||
|
|
||
| return hand | ||
| end |
There was a problem hiding this comment.
Nice work on this method! This is a good strategy. Actually, although you're right that sometimes you need to make a copy of variables, in this case, you don't need copy_of_letters. You can replace copy_of_letters here with letters and the tests still pass! Let me know if you have questions on that!
| letters_array.each do |letter| | ||
| score = score_chart.find {|points, letters| | ||
| letters.include?(letter) | ||
| }.first |
| end | ||
|
|
||
| winning_word = nil | ||
| sorted_words = winning_words.sort_by(&:length) |
| verdict = false | ||
| end | ||
| return verdict | ||
| end |
| verdict = false | ||
| end | ||
| return verdict | ||
| end |
There was a problem hiding this comment.
Here's an idea for a refactoring if you had more time on this project: Is there a way to take out the else ... verdict = false ? Hint: Could changing the initial value of verdict in verdict = "" to something else help?
| verdict = false | ||
| end | ||
| return verdict | ||
| end |
There was a problem hiding this comment.
Also, do you have any tests for this? ;)
Adagrams
Congratulations! You're submitting your assignment.
Comprehension Questions
Enumerablemixin? If so, where and why was it helpful?