Open garbo999 opened 7 years ago
Here are two more cases I found that are possibly giving the wrong result:
> hand1 = PokerHand.new("Jh 6d Jd 6c Jc Ts Th")
> hand2 = PokerHand.new("Jh 6d Jd 6c Jc 9s 9h")
> hand1.rank
=> "Full house"
> hand2.rank
=> "Full house"
> hand1 > hand2
=> false
> hand1 == hand2
=> true
> hand1.just_cards
=> "Ah Kd Ad Kc Ac Ts Th"
> hand2.just_cards
=> "Ah Kd Ad Kc Ac 9s 9h"
> hand1.rank
=> "Full house"
> hand2.rank
=> "Full house"
> hand1 > hand2
=> true
> hand1 == hand2
=> false # should be a tie?
Hi @garbo999. Sorry I haven't looked at this project in a long time. I can confirm that ruby-poker is intended to support 7 card hands. Therefore I think this is a real bug in the full house rank algorithm. I am not sure what the problem is though. I am unlikely to spend time on this but I will review pull requests.
I wonder if
ruby-poker
was designed to support 7-card hands (2-card hand + 5-card board, like in Texas Holdem)?The gems does seem to support 7-card hands. But then I came across this case, which appears incorrect:
I should mention that I have been using
ruby-poker
to test my own program. So far it has behaved perfectly, but I wonder about this one case. :-)