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

Scrabble- Octos- Brandy & Ari! #12

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

Conversation

arrriiii
Copy link

Scrabble

Congratulations! You're submitting your assignment.

Comprehension Questions

Feature Feedback
What are the advantages of using git when collaboratively working on one code base? It allows both people to keep track of the project status.
Why do you think we chose to make the score method in the Scoring class a class method instead of an instance method? Scoring calculates the points for each word - it's focus is game functionality rather than the actions of player. We don't need to manipulate the instance after creating it.
Describe an example of a test you wrote for a nominal case. We had the player play 'cat' to ensure that it tracked the players score with a simple word.
Describe an example of a test you wrote for an edge case. We had the player play 'oxyphenbutazone' to ensure that it tracked the players score with an invalid word.
Does your code use any methods from the Enumerable mixin? If so, where and why was it helpful? We used some of these methods but have a lot of opportunities to implement them in our current code if we were to refactor.
What was one method you and your pair used to debug code? We followed the stack trace to debug some of our tests.
Is there a specific piece of code you'd like feedback on? Additional comments on how we can refactor scoring---self.highest_score_from.
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 discussed our different ways of processing the material - one thinks by rubber-ducking and one thinks by driving. 2) We also discussed how we had a hard time writing the tests then writing the code. We gravitated toward writing the tests after writing the code.

arrriiii and others added 30 commits February 20, 2018 16:37
Merging to account for Wave 2 instructions
Merging in attempt to update project instructions
@kariabancroft
Copy link

Scrabble

What We're Looking For

Feature Feedback
General
Answered comprehension questions Yes
Both Teammates contributed to the codebase Yes - though towards the end it did get a little bit one-sided
Regular Commits with meaningful commit messages Yes - though admittedly the commit messages could be more explicit about what the commit contains
Scoring class
score method
Uses appropriate data structure to store the letter score Not quite - storing the letters separate from the values works because you've made it work, but it definitely not the ideal data structure for this data. Ideally they are stored directly mapped to one another.
Appropriately handles edge cases Yes - good.
highest_score_from method
Appropriately handles edge cases Yes - looks good
Test implementations for highest_score_from Yes, good - You're using the local variable array_of_words unnecessarily because you never use it again within the test
Player class
Uses an array to keep track of words played Yes
Uses existing code to create highest_scoring_word and highest_word_score Sort of - you're using the score method but what about highest_scoring_from?
Returns true or false from won? method Yes
Tests edge cases on the play(word) Good - see inline comments
TileBag class
Uses a data structure to keep the set of default tiles in the bag Yes - though same as score, i'd keep these in one data structure together rather than two separate structures.
draw_tiles method uses the parameter to draw a set of random tiles Yes - good
tiles_remaining method returns a count Yes
Tests draw_tiles edge cases Yes

Overall you did a nice job with this assignment. There are a few things you can clean up but you demonstrated practice with the major learning goals.

letters_groups.each_with_index do |group, index|
matches = []

matches = word.scan(group)

Choose a reason for hiding this comment

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

Cool use of scan

def self.highest_score_from(array_of_words)
return nil if array_of_words.empty?

Choose a reason for hiding this comment

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

I like this initial "short circuit" of the method to not do any more logic

# # .max on array_of_scores if we want just one, no duplicates
# # Maybe we could do array_of_scores.rindex(array_of_scores.max) which would return the index for the max score which is equal to the index for the corresponding word in array_of_words

array_of_scores.each_with_index do |score, index|

Choose a reason for hiding this comment

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

This would be a great place to use an enumerable method!

player = Scrabble::Player.new("Ari")
# pass word to .play to reach @total_score < 10
player.play('cat')
player.play('dog').must_equal 5

Choose a reason for hiding this comment

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

The it description does't match your assertion here

return picked_tiles
end

return nil

Choose a reason for hiding this comment

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

Though it is functionally the same - i'd recommend using the else here to return nil since it is easier to read.

end
end

@tiles_remaining = 96

Choose a reason for hiding this comment

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

It'd be much better to dynamically grab this # from the collection rather than hard coding it so that if one of the letter counts changed above, you wouldn't need to update this value.

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