News for hackers. Stuff that matters.
Re:Show HN: A simple Poker API to calculate the winning hand/s by Zanni on Sunday July 05, 2020 @05:49PM (#23742375)
If you don't need everything that's going on in poker-eval, you should be able to roll your own two dozen lines of Python.

A poker hand evaluator is problem #54 at Project Euler. [0] Peter Norvig has a solution there (which you can view after you submit your own correct solution) that taught me a lot about Python-style and how it differs from C++ (which was my mindset at the time).

[0] https://projecteuler.net/problem=54

Re:Show HN: A simple Poker API to calculate the winning hand/s by im3w1l on Sunday July 05, 2020 @07:34PM (#23743136)
That's very nice, much shorter than mine. array[[i][/i]r] had me scratching my head for a few minutes, when I realized those were stray italic tags. My only complaint is he doesn't check for the wheel, but to be fair most solutions don't seem to.
Re:Show HN: A simple Poker API to calculate the winning hand/s by Zanni on Sunday July 05, 2020 @10:17PM (#23744058)
The wheel is excluded by the problem definition (or rather, not specifically included). The ace only counts as a high card here.
Re:Show HN: A simple Poker API to calculate the winning hand/s by dragonwriter on Monday July 06, 2020 @01:33AM (#23745007)
> The wheel is excluded by the problem definition (or rather, not specifically included).

Excluded was correct, if only indirectly: a straight is defined as five cards of consecutive value and aces are explicitly the highest (and not also the lowest) values, so the wheel is not a valid straight by the definition given.

Re:Show HN: A simple Poker API to calculate the winning hand/s by im3w1l on Monday July 06, 2020 @12:58AM (#23744846)
Fair enough. I think the problem statement does not have enough information by itself (especially concerning how rank is used to break ties for two pairs), and so it invites people to fill in the blanks using their knowledge of the game.