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

Brittany and Maddie #25

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

Conversation

brittanyrjones
Copy link

@brittanyrjones brittanyrjones commented Feb 26, 2018

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? The advantages of using git to collaborate: Two people can work on the code at the same time, and compare their changes. Another advantage, is that one person can make a change in the code, and the other person can pull those changes, and continue to work on the code. This is especially helpful when there is a driver, and the driver role switches.
Why do you think we chose to make the score method in the Scoring class a class method instead of an instance method? The score method in the scoring class is a class method instead of an instance method because it will need to be accessed by each player. each time there is a new instance of player, we will not have to redefine a scoring method.
Describe an example of a test you wrote for a nominal case. One example of a nominal test, was if there were a total of 98 tiles, then you could not continue to draw tiles if there were already 98 drawn.
Describe an example of a test you wrote for an edge case. An edge case that we tested was if there were no tiles drawn at all, and if there were more than 98 tiles drawn (5000 tiles).
Does your code use any methods from the Enumerable mixin? If so, where and why was it helpful? Yes, one place we used it was "if max_score_words.any?
What was one method you and your pair used to debug code? One method we used was writing a test to fail, (drawing tiles) and then looking at the stack trace to see if the code was breaking exactly where we were expecting it to break. Another method we tried to use (not as successful as hoping) was using the pry method to stop our code execution where we wanted to input our own numbers to see how the code was running.
Is there a specific piece of code you'd like feedback on? We had a lot of issues with the player class. We wanted to make sure we worked on this together, because when we came together to talk about our solutions, it seemed that we came up with better solutions when we worked together, and those solutions made sense both of us. When we worked on the code alone, and then came back together to show each other our ideas, it just got a little confusing for us.
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? Feedback: We felt that we worked really well as a team. One barrier for us was not having more time to meld and work out our ideas face to face. It was kind of hard for us to communicate our ideas just through slack and git, as we liked having the whiteboards, and real time demonstration from our partner on their idea. We are still working to complete the player class together.

@CheezItMan
Copy link

Scrabble

What We're Looking For

Feature Feedback
General
Answered comprehension questions Check, we made score and highest_score_from class methods because those actions don't make a lot of sense as a Player action.
Both Teammates contributed to the codebase Both teammate put in commits!
Regular Commits with meaningful commit messages Good commit messages and a good number of commits
Scoring class
score method Check
Uses appropriate data structure to store the letter score Check
Appropriately handles edge cases Check
highest_score_from method Check
Appropriately handles edge cases Check
Test implementations for highest_score_from Check, but also test for varied order in the words.
Player class
Uses an array to keep track of words played Check
Uses existing code to create highest_scoring_word and highest_word_score MISSING
Returns true or false from won? method the method is named wrong.
Tests edge cases on the play(word) Missed the return value. MISSING TESTS
TileBag class
Uses a data structure to keep the set of default tiles in the bag See my notes on this. The hash is problematic.
draw_tiles method uses the parameter to draw a set of random tiles It works, but players are more likely to get a "Z" than they should.
tiles_remaining method returns a count Check
Tests draw_tiles edge cases Check
Summary Just a note, please make sure that any code you submit has proper indentation. It looks like you missed big sections of Wave 2. Maybe you ran out of time a bit? You need to work on testing of course and creating and using instance methods.

# associated with the key and put that in an array of integers


if !character_check.include?(character) || letters.length == 0 || letters.length > 7

Choose a reason for hiding this comment

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

This if doesn't need to be in the loop, at least the checks for the length of the array.

return nil

else
values_of_letters << LETTER_VALUES.fetch(character)

Choose a reason for hiding this comment

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

Instead of using fetch you could just

values_of_letters << LETTER_VALUES[character]

end

it 'if tied, prefer a word with 7 letters' do
array_of_words = ["ww", "bananas"]
Scrabble::Scoring.highest_score_from(array_of_words).must_equal("bananas")

Choose a reason for hiding this comment

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

It's also important to vary the order here, just in case order played a role.

end

it 'if tied and no word has 7 letters, prefers the word with fewer letters' do
array_of_words = ["x", "brasas"]
Scrabble::Scoring.highest_score_from(array_of_words).must_equal("x")

Choose a reason for hiding this comment

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

Same as above


def winner
return @total_score > 100
end

Choose a reason for hiding this comment

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

Fix your indentation!

Also this method should be named: won?

end
end


Choose a reason for hiding this comment

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

highest_word_score???

highest_scoring_word????

end

def play(word)
if winner == false

Choose a reason for hiding this comment

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

This method is supposed to return the score of the word played, or false if the player has already won.


# Creating an instance of letter quantity to be used though class tilebag.
def initialize
@default_set = {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}

Choose a reason for hiding this comment

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

There's a problem with this structure. It gives each letter an equal chance of being drawn despite the fact that there are 2 "M" tiles and 9 "A" tiles. Uh oh!

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