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

Wenjie & Kat - Octos - Scrabble #5

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

Conversation

kseastman
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? We can work independantly, and when we use git pull we can see the changes and decide which version handles the need better.
Why do you think we chose to make the score method in the Scoring class a class method instead of an instance method? Because we never instantiate "Scoring" into a definite object, so it needs to be a class method, since it is functioning as a collection of methods, not as a discrete object.
Describe an example of a test you wrote for a nominal case. In the Scoring class, we wrote a test to return the highest word if there were two words, this is nominal because it is making sure that code responds correctly to anticipated correct input.
Describe an example of a test you wrote for an edge case. Using the Scoring class as an example, in the highest_score_From method, we wanted to test what would happen if the method was passed an empty array. This is not expected input, and therefore, it is an edge case.
Does your code use any methods from the Enumerable mixin? If so, where and why was it helpful? We used max to get the highest scores, it was very useful because we did not have to write our own comparison method to find which score was higher by iterating through the hash.
What was one method you and your pair used to debug code? We used awesome_print and pry to test the output of loops when we were getting results that were not what we expected.
Is there a specific piece of code you'd like feedback on? The play word method in the Player class.
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 learned a lot from working together, from methods and process to thinking about problems overall. We shared our opinions and listened to each other and tried really hard to work things out when we disagreed. We did a good job of breaking to spike so that we could have a reference for further conversation when deciding how to move forward.

kseastman and others added 30 commits February 20, 2018 14:28
Add test parts for the method as well. Tested. Working as expected
kseastman and others added 28 commits February 21, 2018 16:04
 - create constructor in TileBad class
 - create two methods: create_tiles and draw_tiles
 - create instance variable tiles_remaining
 - Change all tiles to array of symbols
 -Add a few in class Player
 -All tests for class Player passed
This test did not pass, need modify code
@CheezItMan
Copy link

Scrabble

What We're Looking For

Feature Feedback
General
Answered comprehension questions Check, I'm glad you two worked together well
Both Teammates contributed to the codebase Both teammates have Commits
Regular Commits with meaningful commit messages Good number of commits, but make the commit messages about the functionality added.
Scoring class
score method Check
Uses appropriate data structure to store the letter score Check, although it could be more compact.
Appropriately handles edge cases Check
highest_score_from method Check, well done!
Appropriately handles edge cases Check
Test implementations for highest_score_from Check, well done
Player class
Uses an array to keep track of words played Check
Uses existing code to create highest_scoring_word and highest_word_score Check
Returns true or false from won? method Check
Tests edge cases on the play(word) Check
TileBag class
Uses a data structure to keep the set of default tiles in the bag Well done
draw_tiles method uses the parameter to draw a set of random tiles Check
tiles_remaining method returns a count Check
Tests draw_tiles edge cases Check, good work testing the edge cases here. You are missing tests for the player draw_tiles method
Summary Very nicely done, you hit all the learning objectives. Good work on testing edge-cases and good work with the draw_tiles and highest_score_from method.

if !(letter =~ /[A-Z]/)
return nil
end
score += letter_score(letter)

Choose a reason for hiding this comment

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

Good use of a helper method.

end

if max_keys.length == 1
return word_score.key(word_score.values.max)

Choose a reason for hiding this comment

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

This is a little awkward. since there is only one max word score, you could return, max_keys.first


letter_quantity.each do |letter, quantity|
quantity.times do
tiles << Scrabble::Tile.new(letter)

Choose a reason for hiding this comment

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

Good choice putting the tiles into an array like this


end

class Tile

Choose a reason for hiding this comment

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

Think about POODR, don't write an additional class unless you need to. This class really isn't doing anything more than a 1-letter string.


plays << word
score = Scrabble::Scoring.score(word)
self.total_score += score

Choose a reason for hiding this comment

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

This totally works, but you might consider making total_score a calculated field (a method) instead of an instance variable.


# Assert
result.length.must_equal 7
result.wont_equal [:A, :A, :A, :A, :A, :A, :A]

Choose a reason for hiding this comment

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

This test is unlikely, but it's not impossible.

result.must_equal 93
end

it 'returns tiles remaining if less than number of tiles requested' do

Choose a reason for hiding this comment

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

Good that you're testing this, I would also assert that result would be equal to 98.


# Assert
result.must_equal 60
end

Choose a reason for hiding this comment

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

You should also have a Player test for drawing tiles.

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