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

Request: Hash suit in accordance to poker rules #11

Open
KWeatherwalks opened this issue Mar 16, 2022 · 1 comment
Open

Request: Hash suit in accordance to poker rules #11

KWeatherwalks opened this issue Mar 16, 2022 · 1 comment

Comments

@KWeatherwalks
Copy link

KWeatherwalks commented Mar 16, 2022

When comparing single cards, it can be helpful to compare the hashed values of two cards to each other.
For instance, if I want to compare the A♠ to the A♣, the A♠ should hash to the greater value.

This follows the usual poker suit hierarchy:
Spades
Hearts
Diamonds
Clubs

Currently, the code in cards.py makes clubs hash to a higher value than spades (ranks being equal).

CHAR_SUIT_TO_INT_SUIT = {

Comparisons between ranks work nicely, but comparison within ranks is not in accordance with the conventional suit hierarchy.

image

Would there be any side-effects with full-hand evaluation by reversing the current ordering of suits?

@ihendley
Copy link
Owner

ihendley commented May 4, 2022

I think this should be fine, but I'm not 100% sure. Make sure to adjust all the relevant class variables in card.py starting with CHAR_SUIT_TO_INT_SUIT. I won't change this in the repo in order to maintain parity with the parent repo, but let me know if you need any more help getting this to work in your project.

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