Skip to content

Conversation

dtingg
Copy link

@dtingg dtingg commented Aug 14, 2019

Adagrams

Congratulations! You're submitting your assignment.

Comprehension Questions

Feature Feedback
What are the components that make up a method? A method is composed of a def keyword, a method name, zero or more parameters, a block, and an end keyword.
What are the advantages of using git when collaboratively working on one code base? Some advantages are: there’s a source of truth (a master code base), collaborators can work simultaneously and share their changes quickly, and you can revert to earlier versions of the code easily (it has version control).
What kind of relationship did you and your pair have with the unit tests? We love tests. It was frustrating when the tests failed, but they were very valuable in checking that we didn’t break the program. We ultimately added a few of our own tests for wave 5.
Does your code use any methods from the Enumerable mixin? If so, where and why was it helpful? We used .min_by to 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.
What was one method you and your pair used to debug code? We used pry-byebug to step through the code and debug a method that wasn’t working the way we expected.
What are two discussion points that you and your pair discussed when giving/receiving feedback from each other that you would be willing to share? When we tried to refactor things, we went back-and-forth until we reached a consensus on what we should do next. If we were unsure of something, we agreed to research it to find the right answer.

@dHelmgren
Copy link

Adagrams

What We're Looking For

Feature Feedback
General
Answered comprehension questions Yes, glad to hear you love tests!
Small commits with meaningful commit messages Yeah! As you work on bigger projects, move away from saying 'wave'. In industry, you define your own waves, so just say what you did!
Code Requirements
draw_letters method nice
Uses appropriate data structure to store the letter distribution yes!
All tests for draw_letters pass yes
uses_available_letters? method yes
All tests for uses_available_letters? pass yes
score_word method yupp
Uses appropriate data structure to store the letter scores yes
All tests for score_word pass yes
highest_score_from method uh-huh
Appropriately handles edge cases for tie-breaking logic yes
All tests for highest_score_from pass yes
Overall Great work on this! It's very clear code and works very efficiently! I do want to encourage you both to use .each more often going forward, as it will reduce clutter in your code!

number.times do
tile_array.push(letter.to_s)
end
end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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|

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you already know this is the winner, don't bother with break, just return!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants