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

Adagrams Prioject Submission: Gessica and Pauline Pair Programming Submission #5

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

Conversation

ghostfruitleaf
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 (what can and will be input into the code), Output/Return (what the method will return), Code Blocks (what the method will do to the input, if there is any, or what it is do when it's called), Method Signature (what the method is called when you want to use it in your program).
What are the advantages of using git when collaboratively working on one code base? We can share or input code at the same time. By committing, we are also saving work -- since our work is pushed to one code base on Git, we can both push and pull changes to the code and have it merged in the same code base.
What kind of relationship did you and your pair have with the unit tests? We alternated roles-- one would code, the other would give input and ensure that there are no errors in code, including when developing the unit test(s) for the optional function. Since the code was written on Repl.it, a copy of the code was on one machine's RubyMine and terminal to be "raked" and pushed to the code base.
Does your code use any methods from the Enumerable mixin? If so, where and why was it helpful? In uses_available letters: Each_char was used on line 61 to iterate through characters in a string and verify whether the characters could be found in the current letters in hand. The same method was used in line 79 to score a specific word by character. For highest_score_from: In line 92, we used map to create an array of hashes containing each word in an array and their score in word_score_hashes. In line 97, max_by was used to find the hash with the winning score. In line 100, select was used to find the winning word. Min_by was used in line 106 to create an array (or a single element, depending on the words in the array) of all winning words with the smallest length. Finally, we used select again on line 114 to create an array of hashes in the has_ten_letters variable of words and their scores where the word had a length of 10.
What was one method you and your pair used to debug code? We used the debugger together on RubyMine as well as puts statements when working on the code together. In some cases, we would identify a bug and each work independently until one person was able to come up with a solution. In other cases, one of us would see something that the other person missed while coding that allowed us to debug what we were coding on.
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 agreed that we were going to alternate roles early on in the project as well as what time we wanted to spend during the week, committing to those hours by setting up a calendar. 2. We never worked on the code unless we were together (save a couple small things) and never spent more than 2 hours a day working on the code. We both feel that if we were to do this project individually, the combined time we take working on our own would be much, much longer than the total time we spent as a pair (about 8-9 hours, which is equivalent to about one work day!). 3. We made time to plan for what we wanted to work on the next day and set up a plan ahead of time to keep us on track. Overall, we are incredibly satisfied with our collaboration and communication (Pauline would like to add that she was very excited to have a chance to practice her Spanish, including pair programming in Spanish! That was scary and super new!) (Gessica was very happy for the opportunity to communicate in Spanish because normally she doesn't speak it while here in the US.)

Copy link
Collaborator

@CheezItMan CheezItMan left a comment

Choose a reason for hiding this comment

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

Overall well done. See my notes about the draw_letters method. Otherwise outstanding work. Nice work getting the bonus.

Comment on lines +41 to +43
while letter_bucket.length < 10
temp_letter_hash = letter_array[rand(26)]
temp_letter = temp_letter_hash.keys[0]
Copy link
Collaborator

Choose a reason for hiding this comment

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

This actually gives you an equal chance of drawing an "A" and a "Z", which shouldn't be possible.

Consider instead adding 9 As and 2Bs etc to an array and then sampling that array.


# verify if the letters in hand are included in the collection of available letters in the array. verify if they are an anagram of some or all of the given letters in hand.

def uses_available_letters?(input, letters_in_hand)
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍


score = word.length > 6 ? 8 : 0

word.each_char{|c| score += score_word[c.upcase]}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider using reduce or sum methods.

Comment on lines +72 to +73
#using the score_word hash to find the score of each word.
def score_word(word)
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

Comment on lines +97 to +101
winning_score = word_score_hashes.max_by{|word| word[:score]}

# find word(s) with same winning_score
winning_word = word_score_hashes.select{|word| word[:score] == winning_score[:score]}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good use of select and max_by

return winning_word
end

def is_in_english_dict?(input)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice work using a CSV file as a dictionary

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