YegorDB / THPoker

Texas Hold'em Poker tool
Apache License 2.0
5 stars 1 forks source link

wrong outputs in some cases. #5

Closed Shakirsadiq6 closed 2 years ago

Shakirsadiq6 commented 2 years ago

`from thpoker.core import Cards, Combo, Hand, Table

combo1 = Combo(hand=Hand("Kh/Ah"), table=Table("8h/9h/Th/Jh/Qh")) print(combo1)` straight flush (A♥, K♥, Q♥, J♥, T♥)

This is a royal flush, not a straight flush.

Also, we have to at least use one card from our hand, otherwise, table cards are the same for every player. And in this case it also picks rankings even if they exist in table cards without using hand cards.

YegorDB commented 2 years ago

Since "royal flush" and "royal straight flush" are just aliases to any ace-high straight flush combinations, there is no separate royal flush combination in this tool.

As this source says (with link) "On the showdown, each player plays the best poker hand they can make from the seven cards comprising their two-hole cards and the five community cards. A player may use both of their own two hole cards, only one, or none at all, to form their final five-card hand. If the five community cards form the player's best hand, then the player is said to be playing the board and can only hope to split the pot, because each other player can also use the same five cards to construct the same hand.".

Shakirsadiq6 commented 2 years ago

OK, thanks for the clarification but I think there should be the output like: one pair(from hand and table cards) one pair(from hand cards only) one pair(from table cards only)

YegorDB commented 2 years ago

It already outputs "one pair".

Shakirsadiq6 commented 2 years ago

It already outputs "one pair".

If someone is also trying to find out whether the best hand is from table cards or from hand cards. They can use Ratio class which shows whether combination base cards include hand cards or not.

https://github.com/YegorDB/THPoker/blob/879f4e728d9fcbcfe5e2f78720836483e2046160/thpoker/core.py#L378

YegorDB commented 2 years ago

If someone is also trying to find out whether the best hand is from table cards or from hand cards. They can use Ratio class which shows whether combination base cards include hand cards or not.

There are some examples of ratio usage in docs.