Skip to content

Conversation

@ChubbyCub
Copy link

Adagrams

Congratulations! You're submitting your assignment.

Comprehension Questions

Feature Feedback
What are the components that make up a method? Components of a method include method signature, parameters, method body, and an optional return statement.
What are the advantages of using git when collaboratively working on one code base? If you and your partner are working simultaneously, you can both see all the changes to the project. Git has a mechanism to merge unconflicted changes. Also, it can notify you if there are conflicting changes to the project.
What kind of relationship did you and your pair have with the unit tests? We were able to investigate the test file to see what we were tested on and can isolate the cases for the failures.
Does your code use any methods from the Enumerable mixin? If so, where and why was it helpful? We utilized include? method to check if the word is in the dictionary. It was helpful because it returns a boolean value to let us know if the word is present in the dictionary.
What was one method you and your pair used to debug code? We placed "puts" at different lines of code to see if the method is resulting in the result that we expected. Later, we learned about debugging in VS Code and found it was easy to keep track of all the variables on the left panel.
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? Explaining thought process as we go because it will help our partner get up to speed or learn new things.

@tildeee
Copy link

tildeee commented Mar 4, 2019

Adagrams

What We're Looking For

Feature Feedback
General
Answered comprehension questions x
Both teammates contributed to the codebase x
Small commits with meaningful commit messages x, try to avoid commit messages that refer to wave, and instead describe what kind of change you made
Code Requirements
draw_letters method x
Uses appropriate data structure to store the letter distribution x
All tests for draw_letters pass x
uses_available_letters? method x
All tests for uses_available_letters? pass x
score_word method x
Uses appropriate data structure to store the letter scores x
All tests for score_word pass x
highest_score_from method x
Appropriately handles edge cases for tie-breaking logic x
All tests for highest_score_from pass x
Overall

Great work on this project, you two! It's very obvious that you two took the time to refactor and find the most elegant solution to the problem. In some ways, I think that this could lead to confusion because you two did very advanced syntax, but in some other ways, I think that it created a beautiful, elegant solution.

Overall, you have some interesting, logical, concise code!

Also, nice work on the optional wave! Especially with adding tests!

Last note... Why was there a change from ' to " in this project?

end
}

return letters.sample(10)
Copy link

Choose a reason for hiding this comment

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

Clever! Nicely done to use the optional argument of sample to get exactly what you need in one line.


def score_word(word)
word = word.upcase
score = (word.length >= 7) ? 8 : 0
Copy link

Choose a reason for hiding this comment

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

Nice ternary!

{:letters => ["K"], :score => 5},
{:letters => ["J", "X"], :score => 8},
{:letters => ["Q", "Z"], :score => 10},
]
Copy link

Choose a reason for hiding this comment

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

Very interesting and cool data structure! It helps give a relationship between the letters and the score, while keeping it flexible in case letters need to move around. It feels a little more difficult to read compared to a just a hash (rather than your array of hashes), but this is still a great solution

Copy link
Author

Choose a reason for hiding this comment

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

Hi Dee! Thank you for the feedback. I agree with you it is better to save the letter/score pairs in a hash. I wanted to save some keystrokes. Would something like this work?

hash = {}
%w("a", "b", "c"). each { |letter| hash[letter] = 1 }
%w("q", "z"). each { |letter| hash[letter] = 10 }

Or is there a better way?

Copy link

Choose a reason for hiding this comment

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

I think that's a great, more readable solution! I like it :)

next
end
end
return {:word => candidate, :score => max_score}
Copy link

Choose a reason for hiding this comment

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

I really like this hash that was made in-line inside of the return! :)

def is_in_english_dict?(input)
# instant look up using set
dictionary = Set.new
CSV.foreach("/Users/elisepham/Ada/adagrams/assets/dictionary-english.csv", headers: true) do |row|
Copy link

Choose a reason for hiding this comment

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

You put in a path to Elise's file on Elise's computer... which doesn't work on every laptop! You should change it to the relative path ./assets/dictionary-english.csv in order for this to work on every machine that uses rake to run the tests

expect(is_in_english_dict?(element)).must_equal false
end
end
end
Copy link

Choose a reason for hiding this comment

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

Great work on writing tests for your new features :)

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