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

winning hand for omaha evaluator #24

Open
elvis501 opened this issue Jul 8, 2020 · 2 comments
Open

winning hand for omaha evaluator #24

elvis501 opened this issue Jul 8, 2020 · 2 comments

Comments

@elvis501
Copy link

elvis501 commented Jul 8, 2020

Hi

I'm testing this for evaluating omaha winning hand. Everything is fine and I get short wining hand description as eg. "4 4 4 A K".

Is it any way to get or calculate "real" winning hand with ranks and suits from rank number? eg ( "4s 4c 4d Ac Kh" )

It would be very useful to see which are the winning cards from community and player cards.

@HenryRLee
Copy link
Owner

Hi @elvis501,

I wanted to implement the same idea as you did, but then I had two concerns when designing this API:

  1. We can see that sometimes the result isn't unique.
  2. The evaluator is using a hash function targeting the ranks. Therefore, some information is lost in the process, particularly the suit information. This is somehow a drawback of the perfect hash algorithm.

Having said that, you can still calculate the original cards and tell whether it is from community or player, given the sample hand (e.g. "4 4 4 A K") and the rank category (we need to know whether it is a flush). If it is a flush, simply find the most common suit from the nine cards. Otherwise, for each rank in the sample hand, we can greedily check whether the player set has a card with that rank. If there is, the rank belongs to the player, otherwise, it belongs to the community. And then take that card out of the player/community set before checking the next rank. You won't lose the correct answer in each iteration. Because if you do (i.e. there is a rank supposed to belong to the community, but had been assigned to the player), then eventually they should be able to compose a better 5-card hand, contradicting the fact that the sample hand is the best 5-card hand.

If you have trouble implementing the calculation, let me know and I will help out.

@stiv-yakovenko
Copy link

How do I use EvaluateOmahaCards if there are only 3 cards on the table?

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

No branches or pull requests

3 participants