-
Notifications
You must be signed in to change notification settings - Fork 26
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
Wini and Caroline - Scrabble - Octos #11
base: master
Are you sure you want to change the base?
Conversation
ScrabbleWhat We're Looking For
|
end | ||
end | ||
|
||
def check_word(word) |
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.
Neat!
i = @tiles.find_index(letter) | ||
@tiles.delete_at(i || @tiles.length) | ||
end | ||
if won? |
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.
I would check to see if you won before deleting tiles from the player's hand.
end | ||
end | ||
|
||
describe "total score" 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.
It would also be a good idea to test that total score doesn't go up if the player keeps playing past winning.
player_1.won?.must_equal true | ||
end | ||
|
||
it "returns false if total score is equal to 100" 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.
Good edge case
end | ||
end | ||
|
||
describe "highest_scoring_word" 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.
What about highest_scoring_word
when no words have been played?
attr_reader :tilebag | ||
|
||
def initialize | ||
@tilebag = ["A", "A", "A", "A", "A", "A", "A", "A", "A", |
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 Choice!
|
||
it "includes 1 Q tile" do | ||
new_game = Scrabble::Tilebag.new | ||
new_game.tilebag.select{ |tile| tile == "Q" }.length.must_equal 1 |
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.
Niiiiice!
end | ||
end | ||
|
||
describe "draw_tiles" 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.
What about if they try to draw more tiles than are in the bag?
Scrabble
Congratulations! You're submitting your assignment.
Comprehension Questions
score
method in theScoring
class a class method instead of an instance method?Enumerable
mixin? If so, where and why was it helpful?