Skip to content

Conversation

@Kimberly-Fasbender
Copy link

Adagrams

Congratulations! You're submitting your assignment.

Comprehension Questions

Feature Feedback
What are the components that make up a method? method signature (def method_name(any parameters), the block, return statement, end
What are the advantages of using git when collaboratively working on one code base? It is a more efficient way of tracking changes, and controlling who has access to the code
What kind of relationship did you and your pair have with the unit tests? At first they were frustrating, but after awhile they became increasingly useful in determining why our code was not working properly, because each test would show us a specific error message.
Does your code use any methods from the Enumerable mixin? If so, where and why was it helpful? Yes, we used several enumerables including .each, .fill, .include?, and .sample. We used .sample in the first method to create an array of unique characters from the letter_pool array. It was helpful because we knew there was no danger of pulling characters in a quantity that was higher than they were available in.
What was one method you and your pair used to debug code? We used puts and print statements and different points during loops to check values of variables, and we used the rake tests.
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 using kind language, and stopping the timer and stepping away from the computer when we needed to research or discuss strategy.

@Kimberly-Fasbender Kimberly-Fasbender changed the title Completed Adagrams Ports - Kim & Ari Feb 22, 2019
@CheezItMan
Copy link

Adagrams

What We're Looking For

Feature Feedback
General
Answered comprehension questions Check, I'm glad the tests became more and more useful. I hope the timer was helpful.
Both teammates contributed to the codebase It seems so.
Small commits with meaningful commit messages Only two commits. In general, add one piece of functionality and commit it, and them move to the next. It's hard to remember and get into the habit, but it will be very useful going forward. That way you can easily roll back small changes and track work done piece by piece.
Code Requirements
draw_letters method Check
Uses appropriate data structure to store the letter distribution Check, well done!
All tests for draw_letters pass Check
uses_available_letters? method Check, see my notes here for a small optimization.
All tests for uses_available_letters? pass Check
score_word method Check
Uses appropriate data structure to store the letter scores Check
All tests for score_word pass Check
highest_score_from method Check
Appropriately handles edge cases for tie-breaking logic Check, Well done!
All tests for highest_score_from pass Check
Overall Nice work! You even started on the extras. Outstanding, you hit all the learning goals for the project.

def draw_letters

# hash that store letters and their quantities
letter_pool = {

Choose a reason for hiding this comment

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

Good structure 👍


# for each key in the pool, add the key in the quantity of its value into the letter_pool_array array
letter_pool.each do |letter, quantity|
letter_pool_array.fill(letter.to_s, letter_pool_array.size, quantity)

Choose a reason for hiding this comment

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

Nice use of fill


# pushes true/false values into an array based on if user input is valid
true_false = []
split_input.each do |letter|

Choose a reason for hiding this comment

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

I would suggest that if you ever encounter a letter not in the hand, that you can then return false.

Good catch in checking the count of the letter in the hand and the count of the letter in the input

# method that calculates an input word's total score
def score_word(word)
# hash with arrays as values, to store our score chart
score_chart = {

Choose a reason for hiding this comment

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

The structure to store the letters mapped to scores, works.

require "csv"

def is_in_english_dict?(input)
dictionary = CSV.read("../assets/dictionary-english.csv")

Choose a reason for hiding this comment

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

If you're running this from the root directory of the project this should be:

dictionary = CSV.read("assets/dictionary-english.csv"

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