Open
Conversation
AdagramsWhat We're Looking For
|
CheezItMan
reviewed
Mar 1, 2019
| return letter_array | ||
| end | ||
|
|
||
| letter_bag = create_letter_array("A", 9) + create_letter_array("B", 2) + create_letter_array("C", 2) + create_letter_array("D", 4) + create_letter_array("E", 12) + create_letter_array("F", 2) + create_letter_array("G", 3) + create_letter_array("H", 2) + create_letter_array("I", 9) + create_letter_array("J", 1) + create_letter_array("K", 1) + create_letter_array("L", 4) + create_letter_array("M", 2) + create_letter_array("N", 6) + create_letter_array("O", 8) + create_letter_array("P", 2) + create_letter_array("Q", 1) + create_letter_array("R", 6) + create_letter_array("S", 4) + create_letter_array("T", 6) + create_letter_array("U", 4) + create_letter_array("V", 2) + create_letter_array("W", 2) + create_letter_array("X", 1) + create_letter_array("Y", 2) + create_letter_array("Z", 1) |
There was a problem hiding this comment.
I'd suggest having a hash with letters and the amount of each letter and using that to generate the letter bag instead of this. Less typing.
| end | ||
|
|
||
| def uses_available_letters?(input, letters_in_hand) | ||
| new_array = letters_in_hand.clone |
There was a problem hiding this comment.
Very clever to use .clone that way you avoid destroying elements of letters_in_hand.
| end | ||
|
|
||
| def score_word(word) | ||
| point_value = [ |
| end | ||
| if winners.length == 1 | ||
| return winning_word | ||
| else # if there's a tie |
There was a problem hiding this comment.
Your indentation is a bit of a mess here.
There was a problem hiding this comment.
Hey Chris, thanks so much for your review & all your feedback -- it's much appreciated! Could you clarify this comment a little more? I'm looking through and trying to see where the indentation could be fixed so that I don't make this mistake again.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adagrams
Congratulations! You're submitting your assignment.
Comprehension Questions
Enumerablemixin? If so, where and why was it helpful?