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

Duplication in Community Card and in inHand cards. in winners() #11

Open
usmansohee opened this issue Aug 4, 2024 · 2 comments
Open

Comments

@usmansohee
Copy link

usmansohee commented Aug 4, 2024

I was playing recently after implementing it in my project, and I encountered an issue.

I got { "rank": "J", "suit": "diamonds" } repeating in both Player 0's hand cards and the community cards.

Winners() List:

[
  [
    [
      0,
      {
        "cards": [
          { "rank": "A", "suit": "hearts" },
          { "rank": "K", "suit": "clubs" },
          { "rank": "Q", "suit": "hearts" },
          { "rank": "J", "suit": "diamonds" },
          { "rank": "T", "suit": "diamonds" }
        ],
        "ranking": 4,
        "strength": 12
      },
      [
        { "rank": "4", "suit": "diamonds" },
        { "rank": "J", "suit": "diamonds" }
      ]
    ],
    [
      1,
      {
        "cards": [
          { "rank": "A", "suit": "hearts" },
          { "rank": "K", "suit": "clubs" },
          { "rank": "Q", "suit": "hearts" },
          { "rank": "J", "suit": "clubs" },
          { "rank": "T", "suit": "diamonds" }
        ],
        "ranking": 4,
        "strength": 12
      },
      [
        { "rank": "J", "suit": "clubs" },
        { "rank": "6", "suit": "hearts" }
      ]
    ]
  ]
]

Although the community cards end with these five cards after the river's betting round, this issue occurs just before processing the results:

Community cards.

[
  { rank: 'K', suit: 'clubs' },
  { rank: 'A', suit: 'hearts' },
  { rank: '4', suit: 'spades' },
  { rank: 'T', suit: 'diamonds' },
  { rank: 'Q', suit: 'hearts' }
]

other information.
0's cards: [ { rank: '4', suit: 'diamonds' }, { rank: 'J', suit: 'diamonds' } ]
1's cards: [ { rank: 'J', suit: 'clubs' }, { rank: '6', suit: 'hearts' } ]

@claudijo
Copy link
Owner

claudijo commented Jan 4, 2025

Sorry for not getting back earlier @usmansohee .

Just to be clear. The winner array contain three components:

  • The player's seat index
  • The five cards constituting the winning hand, and the value of the winning hand (ranking and strength)
  • The player's hole cards (the two cards dealt to each player face down)

Has there been some sort of misunderstanding or is this an actual issue? I can't see any inconsistencies in the JSON data you provide above. (From what I can tell it looks like there was a split pot as both players could form a straight from the community cards and using the Jack from their own hole cards.)

To dig into the potential problem... What do you mean by "issue occurs just before processing the results"? Do you mean at some point before the river community card is dealt, the list of community cards actually contains one of the first player's hole cards (ie "rank": "J", "suit": "diamonds"). Would you know how the list of community cards look when the issue occurs, and how it should look instead if things worked as expected?

@claudijo
Copy link
Owner

@usmansohee , do you mind having a look at the above? Do you believe there is a bug or could there have been a misunderstanding?

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