ToxicMushroom / Melijn

A powerful multi-purpose discord bot
https://melijn.com/
MIT License
76 stars 23 forks source link

Fix poker Two Pair, Full House and Four of a Kind checking #219

Closed zeroeightysix closed 2 years ago

zeroeightysix commented 2 years ago

Poker currently computes a map of rank occurrences and sorts its values ascending in order to check for full house, four of a kind, ...

That means that for a hand like (2,2,2,3,3), the sorted list is (2,3). Unfortunately the first value out of that list is checked for equality with 3 for full house, while it should be the other way around. This PR fixes that behaviour by sorting the list in descending order instead, allowing players to win mel with two pair, full house and four of a kind.

ToxicMushroom commented 2 years ago

thank you