Skip to content

Sockets- Shirley/Sarah#8

Open
sjscotton wants to merge 7 commits intoAda-C11:masterfrom
sjscotton:master
Open

Sockets- Shirley/Sarah#8
sjscotton wants to merge 7 commits intoAda-C11:masterfrom
sjscotton:master

Conversation

@sjscotton
Copy link

Adagrams

Congratulations! You're submitting your assignment.

Comprehension Questions

Feature Feedback
What are the components that make up a method? Methods start with the def keyword, followed by the method signature. Within the method is a chunk of code that ends with a return value. Finally the method is closed with an end keyword.
What are the advantages of using git when collaboratively working on one code base? It allows two people to be working on different parts on a project at the same time.
What kind of relationship did you and your pair have with the unit tests? They were overwhelming at first when we got a huge screen of error messages, but once we got the hang of reading and using them, we found them very helpful to identify and fox bugs.
Does your code use any methods from the Enumerable mixin? If so, where and why was it helpful? We used max_by, min_by, select and map. All of which were used in the highest_score_from method. These enumerable methods allowed us to select from and sort our words data structure to find the best scoring word based on different criteria.
What was one method you and your pair used to debug code? We primarily used the error messages included in the tests to find specific issues and used puts statements to see if if methods were returning the desired output and to visualize the data.
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 discussed out communications styles early, ask vs guess for example, so we were able to be more sensitive to each others styles. We found that we were able to adapt the Driver / Navigator programming to find our own rhythm and groove.

@kaidamasaki
Copy link

Adagrams

What We're Looking For

Feature Feedback
General
Answered comprehension questions Yes
Both teammates contributed to the codebase Yes
Small commits with meaningful commit messages Yes
Code Requirements
draw_letters method
Uses appropriate data structure to store the letter distribution Yes
All tests for draw_letters pass Yes
uses_available_letters? method
All tests for uses_available_letters? pass Yes
score_word method
Uses appropriate data structure to store the letter scores Yes
All tests for score_word pass Yes
highest_score_from method
Appropriately handles edge cases for tie-breaking logic Yes
All tests for highest_score_from pass Yes
Overall Great job! Your code and variable names were clear and readable and you made good use of Git to collaborate.

LETTER_ARRAY = ["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"]

def draw_letters
letter_array = LETTER_ARRAY.clone

Choose a reason for hiding this comment

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

Good catch on needing to clone the array!

def uses_available_letters?(input, letters_in_hand)
input_array = input.upcase.split("").uniq
input_array.each do |letter|
return false if input.count(letter) > letters_in_hand.count(letter)

Choose a reason for hiding this comment

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

Nice use of returning out of the middle of a .each and of trailing if.

return points
end

def highest_score_from(words)

Choose a reason for hiding this comment

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

I really like your use of Enumerable methods in highest_score_from your code is really clear and elegant.

def is_in_english_dict?(input)
CSV.foreach("assets/dictionary-english.csv") do |row|
return true if row[0] == input.downcase
end

Choose a reason for hiding this comment

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

This is clear and works but causes noticeable lag every time a word is entered.

Can you think of a way to only read assets/dictionary-english.csv once?

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.

3 participants