Open
Conversation
AdagramsWhat We're Looking For
|
dHelmgren
reviewed
Aug 20, 2019
| number.times do | ||
| tile_array.push(letter.to_s) | ||
| end | ||
| end |
There was a problem hiding this comment.
This is a very neat solution to the problem here!
| def uses_available_letters?(input, letters_in_hand) | ||
| user_string = input.upcase | ||
| letters_to_check = letters_in_hand.dup | ||
| user_string.length.times do |i| |
There was a problem hiding this comment.
Any reason you're using a times do instead of an each do?
| word.length.times do |i| | ||
| letter = word[i].upcase | ||
| score_total += score_hash[letter.to_sym] | ||
| end |
There was a problem hiding this comment.
You should get used to the .each loop syntax! This loop becomes much easier to read with it!
word.each do |letter|
score_total += score_hash[letter.upcase.to_sym]
end
| highest_words.each do |word| | ||
| if word.length == 10 | ||
| winning_word = word | ||
| break |
There was a problem hiding this comment.
If you already know this is the winner, don't bother with break, just return!
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
defkeyword, a method name, zero or more parameters, a block, and anendkeyword.Enumerablemixin? If so, where and why was it helpful?.min_byto find the word with the shortest length in our list of highest-scoring words. It was helpful because it returned the first item even if there was a tie.