scoring is functional!

This commit is contained in:
swaits committed 2008-08-28 18:52:35 -07:00
1 parent 781bb1aa5a
commit 6ad0b7e9d2
4 files changed
+169 -74

No files matched your search

+10 -18
View File
@@ -23,30 +23,22 @@ class Card
end
end
def to_s
rank_s + " of " + suit_s
end
def rank_s
case @rank
when 2 then "two"
when 3 then "three"
when 4 then "four"
when 5 then "five"
when 6 then "six"
when 7 then "seven"
when 8 then "eight"
when 9 then "nine"
when 10 then "ten"
when 11 then "jack"
when 12 then "queen"
when 13 then "king"
when 14 then "ace"
when 2..10 then @rank.to_s
when 11 then "Jack"
when 12 then "Queen"
when 13 then "King"
when 14 then "Ace"
end
end
def suit_s
@suit.to_s
@suit.to_s.capitalize
end
def to_s
rank_s + "-" + suit_s
end
def ==(other)