Skip to content

Fire - Noor and Anna - #17

Open
annakim93 wants to merge 8 commits into
Ada-C14:masterfrom
annakim93:master
Open

Fire - Noor and Anna#17
annakim93 wants to merge 8 commits into
Ada-C14:masterfrom
annakim93:master

Conversation

@annakim93

Copy link
Copy Markdown

Assignment Submission: Adagrams

Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.

Reflection

Feature Feedback
What are the components that make up a method? Each method takes arguments and includes a code block that is run so we don't need to repeat code and can return something.
What are the advantages of using git when collaboratively working on one code base? Git helps us see what changes were made (version history), which helps with proper collaboration and communication between team members.
What kind of relationship did you and your pair have with the unit tests? We switched off being driver and navigator
Does your code use any methods from the Enumerable mixin? If so, where and why was it helpful? We used 'first' to get the first 10 letters after shuffling to make the hand of letters. We used 'chars' to create an array from a string with each character. We used 'map' to get the points for each word and the lengths of each word.
What was one method you and your pair used to debug code? We used 'p' to print and we made our own inputs to see if our code worked the way we expected.
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? 1) When we were overcomplicating, we took a step back and talked about what we want the code to do and were able to get to a simpler solution. 2) We made sure to have fun while working, so even when we struggled in some parts, we enjoyed learning together.

@CheezItMan CheezItMan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Overall not bad. You hit the main learning goals here. However check out my comments on highest_score_from. I'm not convinced it works in all cases.

Comment thread .gitignore
Comment on lines +4 to +5
.floo
.flooignore

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Smart!

Comment thread lib/adagrams.rb
@@ -0,0 +1,129 @@

LETTERS = {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Nice way to set up the distribution of letters.

Comment thread lib/adagrams.rb
}

# WAVE 1
def draw_letters()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍

Comment thread lib/adagrams.rb

# WAVE 2

def uses_available_letters?(input, letters_in_hand)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍

Comment thread lib/adagrams.rb

# Wave 3

def score_word(word)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍

Comment thread lib/adagrams.rb
return hash
elsif length < 10
min_length = word_lengths.min
hash[:word] = words[word_lengths.index(min_length)]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This might not work in all cases. What if there is a non-winning word with an equal length

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Ah I see! Because we are checking through all the words that are passed as an argument, when we should be looking at the subset that has the highest points - is that right?

Comment thread lib/adagrams.rb
Comment on lines +113 to +115
hash[:word] = words[word_lengths.index(length)]
hash[:score] = points[word_lengths.index(length)]
return hash

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

You don't know if the word with length 10 is tied for the highest score here.

Comment thread lib/adagrams.rb

# Wave 4

def highest_score_from(words)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I am uncertain that this method will work in all cases. See my comments below.

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