Live data from Hacker News

Show HN: A simple Poker API to calculate the winning hand/s

pokerapi.dev

11–20 of 45 posts

Re: Show HN: A simple Poker API to calculate the winning hand/s

#11
post #3

Calculating odds would be more interesting

I agree. Not sure how this helps improve poker play.

I doubt it’s supposed to, it’s to calculate who wins when writing your own poker implementation. I am not the author, but calculating the winner is non trivial.

Re: Show HN: A simple Poker API to calculate the winning hand/s

#13
post #4

What are you using under the hood? I’ve been using poker-eval for a few projects but it seems its now abandonware, with few updates out there. I’m tempted to port it to Go and/or Rust to keep it alive, but I’m interested in what else people are using out there for poker hand evaluation.

Im using a two plus two hand evaluator i found in Java. Curious as well couldn’t find good open source ones

The Twoplustwo evaluator is open source ("GPL, use as you like" specifically)

Third party repo: https://github.com/tangentforks/TwoPlusTwoHandEvaluator

Original statement of license: https://forumserver.twoplustwo.com/showpost.php?p=1482536&po...

Re: Show HN: A simple Poker API to calculate the winning hand/s

#14

What are you using under the hood? I’ve been using poker-eval for a few projects but it seems its now abandonware, with few updates out there. I’m tempted to port it to Go and/or Rust to keep it alive, but I’m interested in what else people are using out there for poker hand evaluation.

For Python I'd recommend: https://github.com/worldveil/deuces

Re: Show HN: A simple Poker API to calculate the winning hand/s

#15
post #6

What are you using under the hood? I’ve been using poker-eval for a few projects but it seems its now abandonware, with few updates out there. I’m tempted to port it to Go and/or Rust to keep it alive, but I’m interested in what else people are using out there for poker hand evaluation.

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/proble…

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

#16

Earlier quoted context omitted.

I agree. Not sure how this helps improve poker play.

I doubt it’s supposed to, it’s to calculate who wins when writing your own poker implementation. I am not the author, but calculating the winner is non trivial.

Is it not? The win criteria is well specified so just iterate downwards from the highest priority win until you find a match?

Re: Show HN: A simple Poker API to calculate the winning hand/s

#18
post #16

Earlier quoted context omitted.

I doubt it’s supposed to, it’s to calculate who wins when writing your own poker implementation. I am not the author, but calculating the winner is non trivial.

Is it not? The win criteria is well specified so just iterate downwards from the highest priority win until you find a match?

Sure, but that gets complicated when comparing two matching hands (flush vs flush, 2 pair vs 2pair). It’s more than a 50 line problem to solve.

Re: Show HN: A simple Poker API to calculate the winning hand/s

#20
post #16

Earlier quoted context omitted.

Is it not? The win criteria is well specified so just iterate downwards from the highest priority win until you find a match?

Sure, but that gets complicated when comparing two matching hands (flush vs flush, 2 pair vs 2pair). It’s more than a 50 line problem to solve.

I had the same initial reaction as the other person. Should be easy right? I think you’re right though, there are probably many more steps to getting this right than it seems on the surface.

I kind of want to take your 50 line challenge however :) I always loved playing poker, might be a fun exercise.

Post reply on HN