Skip to content

Conversation

KKennedyCodes
Copy link

Adagrams

Congratulations! You're submitting your assignment.

Comprehension Questions

Feature Feedback
What are the components that make up a method? A method includes the message signature along with any parameters the method requires to run. After the message signature, the code is written in the block of the method. A method must return a value. If the return is not specified, the method will return the last line in the block.
What are the advantages of using git when collaboratively working on one code base? Git and Git Hub make it easier for people to share and collaborate on coding projects. By being able to fork and clone a project, programmers can write code on their machines and then push it back to their collaborators. The Git tools show the status of changes made and help to create mini-milestones or checkpoint by committing changes made. Git Hub also allows collaborators and teams to work together.
What kind of relationship did you and your pair have with the unit tests? We used the wave tests along with rake repeatedly throughout our development process. The tests helped our team by providing the code for the user experience which let us just work on the back end of the program.
Does your code use any methods from the Enumerable mixin? If so, where and why was it helpful? We used the each method to cycle through our arrays to look for specific information and compare values. We also used the length method in our tie breaker method to find the overall winner.
What was one method you and your pair used to debug code? To debug our code, we relied on reading the stack trace, as well as, reading through and interpreting the rake results.
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 our learning styles and how we prefer to receive feedback before we started the project.

@beccaelenzil
Copy link

Adagrams

What We're Looking For

Feature Feedback
General
Answered comprehension questions yes
Small commits with meaningful commit messages consider adding a few more details. For example, you pivoted your approach for wave 4. This should be reflected in your commits.
Code Requirements
draw_letters method
Uses appropriate data structure to store the letter distribution yes -- see code review for alternative suggestions
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 -- see code review for alternative suggestions
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 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 made a few comments on how you could store the data differently to simplify your logic. In addition, make sure to head any warnings from rake to clean up your code and remove unnecessary variables.

sum = 0
total_sum = 0

score_hash = {1=> ["A", "E", "I", "O", "U", "L", "N", "R", "S", "T"], 2=> ["D", "G"],

Choose a reason for hiding this comment

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

An alternative approach would be to store the letter scores in a hash, something like this:

LETTER_SCORES = {
  "A" => 1
  "B" => 3,
  "C" => 3,
  "D" => 2,
  # ...
}

Then to get the score for a letter, you can say LETTER_SCORES[letter].

You could create this hash from your original array of hashes raw_tiles

Organizing the data this way would simplify the logic below.

# Return word and score of word with highest score
def highest_score_from(words)
high_score_hash = {word: "", score: 0}
high_score = 0

Choose a reason for hiding this comment

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

We reworked the logic for this method and you don't end up using high_score and high_score_length. Rake provided this warning for you:

/Users/becca/Documents/GitHub/c12/adagrams/lib/adagrams.rb:90: warning: assigned but unused variable - high_score
/Users/becca/Documents/GitHub/c12/adagrams/lib/adagrams.rb:91: warning: assigned but unused variable - high_score_length
/Users/becca/Documents/GitHub/c12/adagrams/lib/adagrams.rb:46: warning: assigned but unused variable - letters_in_hand

You should remove these variables from your code.

return word1
end


Choose a reason for hiding this comment

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

For the sake of cleanliness, remove these extra lines.


tile_set = []

# extracts letter and score keys and puts them in array called raw_tiles

Choose a reason for hiding this comment

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

Clever use of the data structure you created. Consider also how you could use a data structure organized like this: {"A"=>9, "B"=>2,...}

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