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

Cara & Emilce -- Scrabble -- Octos #15

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

Conversation

emilcecarlisa
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? Ability to merge and reconcile changes. Working remotely is made easy.
Why do you think we chose to make the score method in the Scoring class a class method instead of an instance method? So that it can be updated by multiple instances
Describe an example of a test you wrote for a nominal case. Tested the score of word.
Describe an example of a test you wrote for an edge case. Tested if we received nil.
Does your code use any methods from the Enumerable mixin? If so, where and why was it helpful? We used max and each with object method. It was helpful being concise and implicitly returning objects.
What was one method you and your pair used to debug code? We used puts statements and pry ocassionally.
Is there a specific piece of code you'd like feedback on? The draw tiles method in the tiles file.
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 discussed communication styles and working on specific tasks.

@emilcecarlisa emilcecarlisa changed the title Scrabble.rb Cara & Emilce -- Scrabble -- Octos Feb 24, 2018
@CheezItMan
Copy link

Scrabble

What We're Looking For

Feature Feedback
General
Answered comprehension questions Check
Both Teammates contributed to the codebase Both members committed!
Regular Commits with meaningful commit messages Good number of commit, You should focus less on the waves and numbered tests passed and more on the functionality you added in your commit messages.
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
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, but I left one note.
Returns true or false from won? method Check
Tests edge cases on the play(word) Yes, except for the case where I user keeps playing after they've won (what happens to the list of words played?)
TileBag class
Uses a data structure to keep the set of default tiles in the bag Neat use of Enumerables to turn the hash into an array.
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 MISSING Only one test for TileBag
Summary Overall nice work, it looks like you ran out of time for TileBag testing, but overall very well done.

@tile_bag = BAG.each_with_object([]) { |(letter, value),tile_bag|
#iterate through the letters val times and shovel the
#letter to the individual letter tilebag
value.times { (tile_bag << letter.to_s)}} #

Choose a reason for hiding this comment

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

small indentation error. The above loops also look awkward. They are however an awesome way to turn the hash above into an array.

class Scoring
SCORING_RUBRIK = {

Choose a reason for hiding this comment

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

Good use of a constant, and a good choice of data structure!


elsif score == highest_score
# highest_word =
self.break_tie(highest_word, word)

Choose a reason for hiding this comment

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

Nice, a helper method!

end

def self.break_tie(incumbent, challenger)

Choose a reason for hiding this comment

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

Nicely done here

end

it 'returns the highest word if there are two words' do
words = []
words.push("zebra", "otter")

Choose a reason for hiding this comment

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

I suggest also varying the order of the words since that makes a difference in a tie.

# return @words_played
end

def play(word)

Choose a reason for hiding this comment

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

Problem here, even if I've won it pushes the new word into @words_played

end

def total_score()
word_scores = @words_played.map do |word|

Choose a reason for hiding this comment

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

Good practice with .map and .inject

end

def highest_word_score
highest_word = Scrabble::Scoring.highest_score_from(@words_played)

Choose a reason for hiding this comment

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

Couldn't you just use the highest_scoring_word here?


end

it "returns score of a play/word " do

Choose a reason for hiding this comment

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

What about a test for what happens if you keep playing after you won?

value.times { (tile_bag << letter.to_s)}} #
end

puts "#{@tile_bag}"

Choose a reason for hiding this comment

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

puts is unneeded here:

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