-
Notifications
You must be signed in to change notification settings - Fork 19
Queues - Cynthia Cobb and Sahana Murthy - Scrabble #3
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
base: master
Are you sure you want to change the base?
Conversation
…ase insensitive words
…t draft of Player class initialize program.
Merge branch 'master' of https://github.com/sahanamurthy/Scrabble
…ring_word in Player class
Merge branch 'master' of https://github.com/sahanamurthy/Scrabble
Merge branch 'master' of https://github.com/sahanamurthy/Scrabble
ScrabbleWhat We're Looking For
Great work overall! Code is clean and readable, and git hygiene looks good. Test coverage is mostly spot on. There were a few failure cases I would like to see covered explicitly - most of these are called out above. In general, keep up the good work. |
| # The & calls to_proc on the object | ||
| # Returns a proc object that expects a parameter and calls a method | ||
| # parameter is the tie_words and the method is length | ||
| return tie_words.min_by(&:length) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work doing the research on procs. However, I'm not sure this implementation will work in every case - I think line 17 needs to be outside the each loop. As a test case, try ['zzzzzz', 'aaaaaah']
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also good work abstracting this as its own method!
|
|
||
| describe "Scoring#highest_score_from" do | ||
|
|
||
| before do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice use of before here.
| attr_reader :tile_bag | ||
|
|
||
| def initialize | ||
| @tile_bag = [ "A", "A", "A", "A", "A", "A", "A", "A", "A", "B", "B", "C", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While impressive-looking, a big literal array like this is hard to manage. Say your boss comes in with the news that Scrabble should now include 9 "E"s - how many do you have now? You'll have to count, which is error prone.
A better way of storing this information might be something like you did in the Scoring class, a hash where each letter maps to its number of tiles. You'd then want to iterate over it to generate the tile bag itself.
| end | ||
|
|
||
| def draw_tiles(num) | ||
| raise ArgumentError unless num.class == Integer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about negative numbers?
Scrabble
Congratulations! You're submitting your assignment.
Comprehension Questions
scoremethod in theScoringclass a class method instead of an instance method?