Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rachael and Li #21

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Rachael and Li #21

wants to merge 12 commits into from

Conversation

nerdyistrendy
Copy link

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? Parameters, method name, and the block which contains the code, including return value.
What are the advantages of using git when collaboratively working on one code base? Each person can work on their own computer and sync.
What kind of relationship did you and your pair have with the unit tests? We rotate between being the navigator and the driver so both of us would have the chance to write out the code.
Does your code use any methods from the Enumerable mixin? If so, where and why was it helpful? We used .map .max .sort. It is helpful because it makes our code more readable and shorter.
What was one method you and your pair used to debug code? Use put statements to make sure we get the right output
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. Checked in with each other to make sure both of our opinions count (such as who wants to be the navigator/driver). 2. Respect each other's schedule.

Copy link

@kaidamasaki kaidamasaki left a comment

Choose a reason for hiding this comment

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

Great job! You made good use of several enumerable methods to clean your code up and just generally seemed to have a focus on keeping your code concise.

Adagrams

Major Learning Goals/Code Review

Criteria yes/no, and optionally any details/lines of code to reference
Correctly creates and calls methods with proper syntax (parameters, return statements, etc.) ✔️
Uses correct syntax for conditional logic and iteration ✔️
Practices git with at least 3 small commits and meaningful commit messages ✔️
Utilizes unit tests to verify code; tests can run using the command $ rake and we see test successes and/or failures ✔️
Practices pair programming; the reflection question on pair programming is answered ✔️

Functional Requirements

Functional Requirement yes/no
For the draw_letters method, there is an appropriate data structure to store the letter distribution. (You are more likely to draw an 'E' than an 'X'.) ✔️
Utilizes unit tests to verify code; all tests for draw_letters and uses_available_letters? pass ✔️
Utilizes unit tests to verify code; all tests for score_word pass ✔️
Utilizes unit tests to verify code; all tests for highest_score_from pass ✔️

Overall Feedback

Overall Feedback Criteria yes/no
Green (Meets/Exceeds Standards) 4+ in Code Review && 3+ in Functional Requirements ✔️
Yellow (Approaches Standards) 3+ in Code Review && 2+ in Functional Requirements
Red (Not at Standard) 0-2 in Code Review or 0,1 in Functional Reqs, or assignment is breaking/doesn’t run with less than 5 minutes of debugging

Code Style Bonus Awards

Was the code particularly impressive in code style for any of these reasons (or more...?)

Quality Yes?
Perfect Indentation
Elegant/Clever
Descriptive/Readable
Concise
Logical/Organized


def uses_available_letters?(input, letters_in_hand)
result = []
input_arr = input.split("")

Choose a reason for hiding this comment

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

You can make this a little clearer using chars:

Suggested change
input_arr = input.split("")
input_arr = input.chars

Comment on lines +40 to +42
temp_pool = letters_in_hand.map do |letter|
letter
end

Choose a reason for hiding this comment

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

Good job making a copy of the data before you modified it!

Tip: You can make a copy more easily using dup.

Suggested change
temp_pool = letters_in_hand.map do |letter|
letter
end
temp_pool = letters_in_hand.dup

Comment on lines +43 to +55
input_arr.each do |letter|
if temp_pool.include?(letter)
temp_pool.slice!(temp_pool.index(letter))
result << true
else
result << false
end
end
if result.include?(false)
return false
else
return true
end

Choose a reason for hiding this comment

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

You can simplify this using an early return:

Suggested change
input_arr.each do |letter|
if temp_pool.include?(letter)
temp_pool.slice!(temp_pool.index(letter))
result << true
else
result << false
end
end
if result.include?(false)
return false
else
return true
end
input_arr.each do |letter|
if temp_pool.include?(letter)
temp_pool.slice!(temp_pool.index(letter))
else
return false
end
end
return true

This is a common pattern that comes in handy.

Comment on lines +122 to +123
words = ['AAAAAAAAAA', 'EEEEEEEEEE']
print highest_score_from(words)

Choose a reason for hiding this comment

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

It looks like you forgot to remove some code you used for testing in a few places.

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