Open
Conversation
AdagramsWhat We're Looking For
|
CheezItMan
reviewed
Aug 22, 2018
| @@ -0,0 +1,23 @@ | |||
|
|
|||
| def draw_letters | |||
| letters = %W[A A A A A A A A B B C C D D D D E E E E E E E E E E E E F F G G G H H I I I I I I I I I J K L L L L M M N N N N N N O O O O O O O O P P Q R R R R R R S S S S T T T T T T U U U U V V W W X Y Y Z] | |||
| #Wave 1 | ||
| #method that represent the hand of letters that the player has drawn | ||
| def draw_letters | ||
| letters = %W[A A A A A A A A B B C C D D D D E E E E E E E E E E E E F F G G G H H I I I I I I I I I J K L L L L M M N N N N N N O O O O O O O O P P Q R R R R R R S S S S T T T T T T U U U U V V W W X Y Y Z] |
| input.split("").each do |letter| | ||
| if letters_in_hand.include?(letter) | ||
| letters_in_hand.each_with_index do |hand_letter,index| | ||
| if hand_letter == letter |
There was a problem hiding this comment.
This works, it's a little awkward. You can use a method to get the 1st index of a given argument instead of using the loop.
| high[:score] = score_word(word) | ||
| high[:word] = word | ||
| #In the case of tie in scores, prefer the first word with ten letter over the word with fewer tiles | ||
| elsif score == high[:score] && word.length == 10 && high[:word].length != 10 |
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.
Adagram
Congratulations! You're submitting your assignment.
Comprehension Questions
What are the advantages of using git when collaboratively working on one code base? |
Being able to simultaneously access changes to the codes and updates. It is also a tracking repository that enables a collaborative team to view each other's information (somewhat live).
What kind of relationship did you and your pair have with the unit tests?
Our relationship was based on teaching and learning. We took some time to speak, write, drive, navigate, drive a lot and some navigation, researching... We used the unit tests to guide our learning and drive better understanding of the code.
Does your code use any methods from the
Enumerablemixin? If so, where and why was it helpful? We initially utilized .map and opted for .each to instead. We also used include?, see code below during Wave 2 to ensure that users utilized letters from the hand.input.split("").each do |letter| if letters_in_hand.include?(letter)What was one method you and your pair used to debug code?
We used 'pry'/binding.pry several times to debug our codes. Pry allowed us to run our code but also call values to confirm what was being returned. We also discussed with TA/Instructors and tutors along with some of our classmates to support our knowledge and verify our code.
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? | Being able to take time to speak and write more during our time working on this project together.