Adagrams Prioject Submission: Gessica and Pauline Pair Programming Submission#5
Open
ghostfruitleaf wants to merge 4 commits into
Open
Adagrams Prioject Submission: Gessica and Pauline Pair Programming Submission#5ghostfruitleaf wants to merge 4 commits into
ghostfruitleaf wants to merge 4 commits into
Conversation
…r to /lib due to file path testing issues with wave-5-game.rb
CheezItMan
reviewed
Sep 23, 2020
Collaborator
CheezItMan
left a comment
There was a problem hiding this comment.
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] |
Collaborator
There was a problem hiding this comment.
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) |
|
|
||
| score = word.length > 6 ? 8 : 0 | ||
|
|
||
| word.each_char{|c| score += score_word[c.upcase]} |
Collaborator
There was a problem hiding this comment.
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) |
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]} | ||
|
|
Collaborator
There was a problem hiding this comment.
Good use of select and max_by
| return winning_word | ||
| end | ||
|
|
||
| def is_in_english_dict?(input) |
Collaborator
There was a problem hiding this comment.
Nice work using a CSV file as a dictionary
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?