Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Divya and Daniela's Adagrams #3

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

mystioreo
Copy link

Adagrams

Congratulations! You're submitting your assignment.

Comprehension Questions

Feature Feedback
What are the components that make up a method? method signature(poss. including parameters), code block
What are the advantages of using git when collaboratively working on one code base? we were able to collaborate on two computers by pushing and pulling the files back and forth and storing them in a central location
What kind of relationship did you and your pair have with the unit tests? we were able to use the tests to drive our code and help us find errors in our code
Does your code use any methods from the Enumerable mixin? If so, where and why was it helpful? we used .map in uses_available_letters and in score_word. It helped us make working copies of data to use within our blocks without modifying the original data. It also helped us extract specific data from a hash.
What was one method you and your pair used to debug code? we used print, puts, and pry
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 agreed on a direct communication style at the very beginning. We agreed that we both wanted instant feedback from the navigator while driving. This resulted in a lot of conversation while we wrote our code as we were constantly checking in with each other before writing any code.

@dHelmgren
Copy link

Adagrams

What We're Looking For

Feature Feedback
General
Answered comprehension questions Yes, though some of the answers are terse.
Both teammates contributed to the codebase Check ins came from both accounts!
Small commits with meaningful commit messages Your commit messages are good, but as you make bigger projects, you will find that you need to commit in between finishing large chunks of functionality. Consider doing commits when things aren't "done", but are "stable".
Code Requirements
draw_letters method !!!
Uses appropriate data structure to store the letter distribution Yay for array!
All tests for draw_letters pass Yes they do!
uses_available_letters? method See comment!
All tests for uses_available_letters? pass Indeed!
score_word method It works great as is, but see my comment!
Uses appropriate data structure to store the letter scores A hash is a great option here!
All tests for score_word pass p-p-p-pass!
highest_score_from method Using bad data as a default value will get you in trouble sooner or later, see comment!
Appropriately handles edge cases for tie-breaking logic Yeah!
All tests for highest_score_from pass It passes!
Overall Think about optimizing when you get to the end of a project. There are a few bits here and there where your code would have benefitted from a second pass.

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 ]

return (all_letters.shuffle).first(10)

Choose a reason for hiding this comment

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

I love this. Nice one liner!

if hand_copy.include?(alphabet)
hand_copy.delete_at(hand_copy.index(alphabet))
else
value = false

Choose a reason for hiding this comment

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

Why wait until the loop is finished to return this false? If the first element fails, is there any reason to keep checking?

word_array = word.upcase.split('')
scores = word_array.map do |letter|
score_hash[letter]
end

Choose a reason for hiding this comment

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

A different enumerable would allow you to do this with only one loop! Think about how inject/reduce could be used here.


best_word_list = words_with_scores.select{|word, score| score == best_score}

best_word = 'reallybigtestword'

Choose a reason for hiding this comment

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

This shouldn't stay in your final code! Write a case to handle when there is not a current best word, rather than relying on the first entry in best_word_list being overwritten.

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