Skip to content

Conversation

@jillirami
Copy link

Adagrams

Congratulations! You're submitting your assignment.

Comprehension Questions

Feature Feedback
What are the components that make up a method? Define the method, establish parameters if needed, put code in the block, and end the method.
What are the advantages of using git when collaboratively working on one code base? Each contributor can add changes. You can track each commit and see the history.
What kind of relationship did you and your pair have with the unit tests? We ran the unit tests very frequently. We looked at each test that failed and tried to fix that part of our code, one piece at a time. Once we finished a method and were testing a new method, we still checked to make sure we were passing the previous tests.
Does your code use any methods from the Enumerable mixin? If so, where and why was it helpful? We used .map to create a new array in the score word method. In this method we also used .reduce(:+) to calculate the sum of the elements in the array.
What was one method you and your pair used to debug code? We tried talking through what the code was doing in English words (not coding talk) to really see what was going on. We also would print an array or hash to see what the value of the data was at a give point.
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? We both agreed to lead with kindness and sandwich our feedback. We really tried to give constructive feedback. We also talked about Ask vs. Guess culture and realized we both operate between the two in different situations.

@CheezItMan
Copy link

Adagrams

What We're Looking For

Feature Feedback
General
Answered comprehension questions Check, I'm glad you were deliberate in your collaboration and used reduce and map
Both teammates contributed to the codebase Check
Small commits with meaningful commit messages You have pretty good granular commits, but don't reference waves with your commit messages. Instead focus on the functionality you added. Maybe describe the methods created.
Code Requirements
draw_letters method Check
Uses appropriate data structure to store the letter distribution Check
All tests for draw_letters pass Check
uses_available_letters? method Check
All tests for uses_available_letters? pass Check
score_word method Check
Uses appropriate data structure to store the letter scores Check
All tests for score_word pass Check
highest_score_from method Check
Appropriately handles edge cases for tie-breaking logic Check
All tests for highest_score_from pass Check
Overall Well done. You hit all the learning goals for the project. You even got to the optional dictionary. Nice work!

require "csv"

def draw_letters
alphabet = ["a", "a", "a", "a", "a", "a", "a", "a", "a", "b", "b", "c", "c", "d", "d", "d", "d", "e", "e", "e", "e", "e", "e", "e", "e", "e", "e", "e", "e", "f", "f", "g", "g", "g", "h", "h", "i", "i", "i", "i", "i", "i", "i", "i", "i", "j", "k", "l", "l", "l", "l", "m", "m", "n", "n", "n", "n", "n", "n", "o", "o", "o", "o", "o", "o", "o", "o", "p", "p", "q", "r", "r", "r", "r", "r", "r", "s", "s", "s", "s", "t", "t", "t", "t", "t", "t", "u", "u", "u", "u", "v", "v", "w", "w", "x", "y", "y", "z"]

Choose a reason for hiding this comment

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

Interesting choice in data structure for the available letters. It definitely works. Can you think of a concise way to do it?

split_word.each do |l|
index = letters_in_hand.index(l)
if letters_in_hand.index(l) != nil
letters_in_hand.delete_at(index)

Choose a reason for hiding this comment

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

Just a note, that this method is destructive to the letters_in_hand array. So this could result in side effects if you checked to see if multiple words used the letters in hand.

end

def score_word(word)
letters_values = {

Choose a reason for hiding this comment

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

Nice data structure.

return best_word
end

def is_in_english_dict?(input)

Choose a reason for hiding this comment

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

Nice work getting started with this.

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