Earth - Ting-Yi & Ringo#11
Open
ringolingo wants to merge 6 commits into
Open
Conversation
dHelmgren
reviewed
Sep 28, 2020
dHelmgren
left a comment
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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("") |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
currently these tests aren't passing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Assignment Submission: Adagrams
Congratulations! You're submitting your assignment. Please reflect on the assignment with these questions.
Reflection
Enumerablemixin? If so, where and why was it helpful?