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

SHERMAN and FAHMY Adagrams #6

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

Conversation

Peacegypsy
Copy link

Adagrams

Congratulations! You're submitting your assignment.

Comprehension Questions

Feature Feedback
What are the components that make up a method? definition, argument parameters, code block, return statement, end.
What are the advantages of using git when collaboratively working on one code base? both parties are able to edit and see the others changes.
What kind of relationship did you and your pair have with the unit tests? we ran them frequently adn used them to clarify the requirements and debug.
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 which helped us fix a pointer error.
What was one method you and your pair used to debug code? reading through the rake tests and stack traces.
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? patience was good, we worked at a consistent pace and switched roles regularly. Explanations were clear and unbiased.

@dHelmgren
Copy link

Adagrams

What We're Looking For

Feature Feedback
General
Answered comprehension questions Answers are kind of terse, they'd benefit
Both teammates contributed to the codebase Yep yep!
Small commits with meaningful commit messages Clear and small commits! nice work!
Code Requirements
draw_letters method The drawing works, easy to read.
Uses appropriate data structure to store the letter distribution A hash doesn't do what we want in this scenario, see my comments.
All tests for draw_letters pass Pass!
uses_available_letters? method Yeah! Good work!
All tests for uses_available_letters? pass Pass!
score_word method Fancy! Yours is the first to_sym solution I've seen.
Uses appropriate data structure to store the letter scores I love a good case statement!
All tests for score_word pass Pass!
highest_score_from method Most concise answer I've seen! Great job!
Appropriately handles edge cases for tie-breaking logic It sure does!
All tests for highest_score_from pass Pass!
Overall Aside from the snafu with the hash at the beginning, this is a really solid demonstration of your skills!


def highest_score_from(words)
best_word = {word: nil, score: 0}
words.each do |word|

Choose a reason for hiding this comment

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

ONE LOOP I LOVE IT

new_letters = letter_in_hand.map { |i| i }
input.split("").each do |letter|
if !new_letters.include? letter
return false

Choose a reason for hiding this comment

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

Good job returning when you know the outcome!

tiles_drawn = 0
until tiles_drawn == 10
letter = alphabet.keys.sample
if alphabet[letter] > 0

Choose a reason for hiding this comment

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

Using a hash with sample gives an equal 1/26 chance to each letter, instead we need the chances to be weighted.

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