Skip to content
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

Support for 7-card hands #8

Open
garbo999 opened this issue Mar 1, 2017 · 2 comments
Open

Support for 7-card hands #8

garbo999 opened this issue Mar 1, 2017 · 2 comments

Comments

@garbo999
Copy link

garbo999 commented Mar 1, 2017

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:

> hand1 = PokerHand.new("TS TH 2S 3S 2H 3H 3D") # i.e. = 3S 3H 3D TS TH
> hand2 = PokerHand.new("9S 9H 2S 3S 2H 3H 3D") # i.e. = 3S 3H 3D 9S 9H

> hand1.rank
 => "Full house" 
> hand2.rank
 => "Full house" 

> hand1 > hand2
 => false # but should be true?

> hand1 == hand2
 => true # but should not be a tie?

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. :-)

@garbo999
Copy link
Author

garbo999 commented Mar 2, 2017

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?

@robolson
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants