Closed neilconway closed 6 years ago
The problem here is a mismatch between the behaviors of the Rank and Suit constructor. Creating Ranks from characters works as expected, but creating Suits does not. In your particular case you obtain a board of 3h Ad 9c instead of the expected 9d 7d 2c (this you can see by printing board.str()). Since both the unexpected board and hand2 contain the card 9c you get the NaNs when you evaluate it. The most simple fix for you is to replace calls to Suit('d') and Suit('c') by Suit("d") and Suit("c"). This works, because the string constructor works as expected. I also created a pull request (#36) that will fix this unexpected behavior in the future.
The test program below reports:
Please let me know if the test program is using the APIs incorrectly.