Skip to content

Conversation

@nidhiparixitpatel
Copy link

Adagrams

Congratulations! You're submitting your assignment.

Comprehension Questions

Feature Feedback
What are the components that make up a method? The components that make up a method are the method signature, parameters, code, and return.
What are the advantages of using git when collaboratively working on one code base? Git allows us to share changes, work on it at different times and on different computers.
What kind of relationship did you and your pair have with the unit tests? We ran it every time we completed each wave to test each of our methods. We used this to refactor our code.
Does your code use any methods from the Enumerable mixin? If so, where and why was it helpful? We used .sample, .map, .include?, and experimented with many others. They made it easier to manipulate data.
What was one method you and your pair used to debug code? We outputted variables and arrays to make sure they contained what we expected them to. We used the spec file tests to refactor our code.
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 talked about keeping in communication about time spent on project both together and apart. We talked about when and how to share changes through git, through slack, or together on the same screen. We both talked about how we are more on the guess culture side.

@dHelmgren
Copy link

Adagrams

What We're Looking For

Feature Feedback
General
Answered comprehension questions Yes
Both teammates contributed to the codebase For sure!
Small commits with meaningful commit messages "Commit" is not a helpful commit message!
Code Requirements
draw_letters method Good
Uses appropriate data structure to store the letter distribution Yes!
All tests for draw_letters pass Yes
uses_available_letters? method Yes
All tests for uses_available_letters? pass Yes
score_word method Yes
Uses appropriate data structure to store the letter scores yes!
All tests for score_word pass yes
highest_score_from method yes!
Appropriately handles edge cases for tie-breaking logic I believe so!
All tests for highest_score_from pass Yes!
Overall Hey y'all! Great work on this project. Your code fulfills all of the requirements and does it in a readable and reasonable way. The code is clean, and it passes all the tests! I'm making a few comments on this assignment about some suggestions on how to refactor, but they are all optional ways of looking at this code again. Overall, you two have done a great job. Good work!


puts "Using the following letters, create an Adagram"
hand = draw_letters
puts hand

Choose a reason for hiding this comment

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

I'm not sure how exactly you were testing your code, but these lines in between the methods kept me from being able to use the rake command to test your code.

if letters_in_hand.include?(input[i]) == true
letters_in_hand.delete(input[i])
else
result = false

Choose a reason for hiding this comment

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

I'll leave this as a "vague thing" to think about: I think that while you iterate through input.chars, you can actually determine that uses_available_letters? can return false before the loop finishes.

Remember, when you use the return keyword, it will kick the program execution out of the method early, and return whatever value you give it.

adagram_input = gets.chomp.to_s.upcase

def uses_available_letters?(input, letters_in_hand)
letters_array = input.chars

Choose a reason for hiding this comment

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

There doesn't seem to me a good reason to make this re-assignment. In your while you could have just as easily done input.chars.length.

i = 0
while i < 26
number_of_letters[i].times do
letter_pool.push(letters[i])

Choose a reason for hiding this comment

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

I like how you did this. It shows a good understanding of the language!

word_array.each do |word|
if word == input.downcase
input_in_dictionary = true
end

Choose a reason for hiding this comment

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

As above, you could leverage the return keyword here to just bail from the loop as soon as you have the answer.

i = i + 1
end

return letter_pool.sample(10)

Choose a reason for hiding this comment

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

Sample is a good choice here!

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