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

Taylor & Kal's Adagram #24

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

Taylor & Kal's Adagram #24

wants to merge 2 commits into from

Conversation

kashenafi
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? Method signature (meaning, method name & parameter(s)). Starts with 'def' and ends with 'end.' The code inside of it should take specified data and manipulate it to return a desired output.
What are the advantages of using git when collaboratively working on one code base? See the changes the other person made. Keep track of versions.
What kind of relationship did you and your pair have with the unit tests? We were frustrated because our program actually ran the way that was expected, gave desired output, BUT one method did not receive the "right" (for the test) parameter, so we had to go in and refactor that.
Does your code use any methods from the Enumerable mixin? If so, where and why was it helpful? Yes. We used .empty? (to check an array that should hold any winning words that are 10 letters), .each and .map (to iterate over data structures), .length (to check and reference string sizes), .sort_by (to get the hash with the shortest word to the top/first element to pull), to name a few.
What was one method you and your pair used to debug code? Used 'puts' a lot. Used Ruby Tutor (www.pythontutor.com).
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. We talked about Ask vs Guess culture. We are both individually leaning towards "ask," so that helped when coordinating/co-working. 2. Our original plan of approach was to do a wave a day. We both worked on how to be flexible with that in reality (especially because of the interdependency in some methods).

Copy link

@dHelmgren dHelmgren left a comment

Choose a reason for hiding this comment

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

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 (only 2)
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

Quality Yes?
Elegant/Clever
Logical/Organized

Comment on lines +5 to +13
letters = ('A'..'Z').to_a
tally = [9,2,2,4,12,2,3,2,9,1,1,4,2,6,8,2,1,6,4,6,4,2,2,1,2,1]
zipped = Hash[letters.map.zip(tally)]

available_letters = zipped.each_with_object([]) do |(letter, amount), array|
array << (letter * amount).split("")
end

available_letters.flatten! #array that holds each letter times the paired value

Choose a reason for hiding this comment

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

you can do this with a little less effort and a little more legibly by putting all the letters in a hash like so...

hash = { 
'a':9,
'b':2,
'c':2,
#... etc
}

And then pushing the letter into an array the number of times indicated by the hash. That way, if your boss asks you to put in 8 m's instead of whatever is in there now, it's easier to change!

Comment on lines +49 to +65
when "Q", "Z"
sum += 10
when "D", "G"
sum += 2
when "B", "C", "M", "P"
sum += 3
when "F", "H", "V", "W", "Y"
sum += 4
when "K"
sum += 5
when "J", "X"
sum += 8
else #"A", "E", "I", "O", "U", "L", "N", "R", "S", "T"
sum += 1
end
# i += 1
end

Choose a reason for hiding this comment

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

putting a hash here is helpful too, because it lets you change the score value of the letter more reliably!

Comment on lines +104 to +120
print "How many hands would you like to draw? => "
number_of_hands = gets.chomp.to_i

all_hands = []

number_of_hands.times do

p draw_letters

puts "Word?"
word = gets.chomp

all_hands << word
end

puts highest_score_from(all_hands)

Choose a reason for hiding this comment

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

when you make a file like this that doesn't have driver code, it's good to remove any testing tools before you submit the final product. ;)

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