Me and my friends are working on a project together and we are required to use poker evaluation as part of the project.
We used PokerHandEvaluator library to compare poker hands (5vs5). It works well, but there was a case on our Unitests that we notice a bug in the library, rank.h, <,>,<=,>= operators (https://github.com/HenryRLee/PokerHandEvaluator/blob/master/cpp/include/phevaluator/rank.h).
We notice that the rank object returns true when we compare two poker hands that supposed to be marked as a tie.
For example:
Hand 1: 10DIAMOND, 11HEART, 12SPADE, 13CLUB, 1DIAMOND
Hand 2: 10HEART, 11DIAMOND, 12DIAMOND 13HEART, 1CLUB
We used the operator < to compare the two and the returned value was true.
Source code:
Hi!
Me and my friends are working on a project together and we are required to use poker evaluation as part of the project. We used PokerHandEvaluator library to compare poker hands (5vs5). It works well, but there was a case on our Unitests that we notice a bug in the library, rank.h,
<,>,<=,>=
operators (https://github.com/HenryRLee/PokerHandEvaluator/blob/master/cpp/include/phevaluator/rank.h). We notice that the rank object returns true when we compare two poker hands that supposed to be marked as a tie. For example: Hand 1: 10DIAMOND, 11HEART, 12SPADE, 13CLUB, 1DIAMOND Hand 2: 10HEART, 11DIAMOND, 12DIAMOND 13HEART, 1CLUB We used the operator<
to compare the two and the returned value wastrue
. Source code:Our fix is: