claudijo / poker-ts

Texas Hold 'Em Poker table model with convenience features for running real games
MIT License
18 stars 19 forks source link

Tie isn't correctly processed #5

Closed Shahito closed 5 months ago

Shahito commented 5 months ago

Hello.

When a tie occurs, for example :

Player 1 10 of diamonds 9 of hearts

Player 2 10 of hearts 3 of clubs

Board Queen of hearts Queen of clubs Ace of spades 10 of clubs 5 of hearts

In this case, the result is a tie between the two player, the final hand being "two pair (10 & Q) and the highest card (A)". But actually the model return the first player as the only winner. Code (at the end of the round) : table.winners().forEach(winner => { console.log(winner); }); Result : [ [ 0, { cards: [Array], ranking: 2, strength: 305214 }, [ [Object], [Object] ] ] ]

Edit : sorry for the edits, forgot to mention the entire final hand

claudijo commented 5 months ago

Thanks for reporting the issue @Shahito ! Apparently there was an issue if all players in a hand were winners. Fixed now :)