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

Earth - Ting-Yi & Ringo #11

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

Conversation

ringolingo
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? The components that make up a method are the signature (the name and the parameter) and the body (the block of code telling it what to do). One of the methods in our game was uses_available_letters?, which had the signature uses_available_letters?(input, letters_in_hand).
What are the advantages of using git when collaboratively working on one code base? We have a history on github of our changes, which we did use at one point to help debug when we made a change that made old code stop working. It also lets us very quickly each get a copy of code that the other one wrote, making cooperation go much more smoothly.
What kind of relationship did you and your pair have with the unit tests? We had a good relationship with the unit tests because they let us know very quickly if there was something we needed to fix. They functioned as our helpers and debuggers. Also, it was very exciting to see the tests pass.
Does your code use any methods from the Enumerable mixin? If so, where and why was it helpful? We used the enumerable methods .max_by, .select, .any?, .min_by to write our highest_score_from method. Those were useful because we had to compare each of the words in the array to find which of them had the highest score, and then had to compare them against that score and against each other on the basis of length.
What was one method you and your pair used to debug code? We found the tests helpful for debugging, as the results and the stacktrace would often point us toward the specific line and error that was coming up. We also were able to sometimes just spot each other’s errors by reading the code with a fresh pair of eyes.
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 struggled the most in this project on the highest_score_from method and ended up doing a lot of trial-and-error. But, at this stage, we had a good back-and-forth of one partner finding a suggestion and another partner implementing it, which kept us moving quickly. Also, both partners had a great attitude and thought through each other’s suggestions, which led to more progress and made the teamwork go better.

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 ✔️
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?
Perfect Indentation
Logical/Organized


def draw_letters
letter_pool = %W( #{ "A" * 9 + "B" * 2 + "C" * 2 + "D" * 4 + "E" * 12 + "F" * 2 + "G" * 3 + "H" * 2 + "I" * 9 + "J" * 1 + "K" * 1 + "L" * 4 + "M" * 2 + "N" * 6 + "O" * 8 + "P" * 2 + "Q" * 1 + "R" * 6 + "S" * 4 + "T" * 6 + "U" * 4 + "V" * 2 + "W" * 2 + "X" * 1 + "Y" * 2 + "Z" * 1} ).join.split("")
random_letter = letter_pool.shuffle.take(10)

Choose a reason for hiding this comment

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

you can do this in one line with the .sample method!

require 'csv'

def draw_letters
letter_pool = %W( #{ "A" * 9 + "B" * 2 + "C" * 2 + "D" * 4 + "E" * 12 + "F" * 2 + "G" * 3 + "H" * 2 + "I" * 9 + "J" * 1 + "K" * 1 + "L" * 4 + "M" * 2 + "N" * 6 + "O" * 8 + "P" * 2 + "Q" * 1 + "R" * 6 + "S" * 4 + "T" * 6 + "U" * 4 + "V" * 2 + "W" * 2 + "X" * 1 + "Y" * 2 + "Z" * 1} ).join.split("")

Choose a reason for hiding this comment

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

there's a lot going on to make this work, and I wonder if all the steps are necessary? the join and thensplit is particularly suspect.

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

Choose a reason for hiding this comment

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

You can update the score value of each letter more reliably by using a hash here. :)

Comment on lines +183 to +197
it "finds real word in dictionary" do
good_word = "bamboo"
expect(is_in_english_dict?(good_word)).must_equal true
end

it "doesn't find fake word in dictionary" do
bad_word = "zybje"
expect(is_in_english_dict?(bad_word)).wont_equal true

empty_word = ""
expect(is_in_english_dict?(empty_word)).wont_equal true

too_long_word = "incongruous"
expect(is_in_english_dict?(too_long_word)).wont_equal true
end

Choose a reason for hiding this comment

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

currently these tests aren't passing

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