-
Notifications
You must be signed in to change notification settings - Fork 84
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
Add python implementation #6
Comments
I have some advice/guide that may help you with this implementation: You can start implementing a 5-card or a 7-card evaluator only, with unit tests, and make a PR for it. Then make consequential PRs for the rest of the evaluators. It might not be easy to write test codes fully cover all the possible hands (enumerating all possibilities like the C++ implementation, which is using Cactus Kev's evaluator as a reference). To make it easier, you can just write test code only choosing a few examples in each rank category. For example, choose a few hands from Straight Flush, then a few from Four of a Kind, etc. |
Hi. If you don't mind the fact that I'm new to coding, I think I can try this. |
Hi @ohwi, never mind. Try your best! |
Hi @HenryRLee, before writing a code, I want to check my understanding. It would be very helpful if you could comment about my understanding.
In documentation, recursion formula is |
Hi @HenryRLee, thank you for your comment and the information. I'll refer #2 when I work with the |
Hi @HenryRLee, I've done with 5 cards. However, since this is my first time to work using github with others, I want to check something before make a PR...
Thank you. |
Hi @ohwi, you can make a PR once 5-card evaluator is ready, and the rest of the work can go into separate PRs in the future. I would encourage you to include your table test codes to your PR, and I'll probably use them in C/C++ implementations if I find them useful. |
Hi @HenryRLee, I'm working on 6 cards case, and I found that Can you explain the way you iterated to build the table briefly? |
It's because 1620 (which is AAAK2) only exists in 5-card hands. Suppose one more card is introduced in this hand, it either gets a higher card than 2, or goes into a better category (full house or four of a kind). The way I generated the |
Thank you. I missed that the numbers are based on Cactus Kev's algorithm. |
Add python implementation, using the same algorithm, similar to the C++ implementation.
Create a directory named
python
and add python source code in it.The text was updated successfully, but these errors were encountered: