Skip to content

Request: Hash suit in accordance to poker rules  #11

@KWeatherwalks

Description

@KWeatherwalks

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions