Permalink
Browse files

Fix incorrect Low Ace check for Straight.

Somehow an old, incorrect implementation stuck around. Begone!
  • Loading branch information...
1 parent 8c9ef3b commit c1b79d3a888f0a8c101734732fd2995e5e624ed4 @zolrath committed Apr 2, 2012
Showing with 1 addition and 3 deletions.
  1. +1 −3 lib/poker_hand_job/hand_reader.rb
@@ -60,7 +60,6 @@ def self.read(hand)
hands.each{ |is_hand| return hand.send(is_hand) if hand.send(is_hand) }
end
-
def suit
hand.map(&:suit).uniq!
end
@@ -104,13 +103,12 @@ def is_three_of_a_kind?
def is_straight?
start = hand.first.value
- if values == [*start..start+4] || values == [*start..start+3,14]
+ if values == [*start..start+4] || values == [2,3,4,5,14]
return Hand.new("Straight", hand, values.min)
end
false
end
-
def is_flush?
return Hand.new("Flush", hand, values.max, suit.first) if (suit.count == 1)
false

0 comments on commit c1b79d3

Please sign in to comment.