4 ms·
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
by PaulRobinson 6y ago
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.
- dberg 6y agoIm using a two plus two hand evaluator i found in Java. Curious as well couldn’t find good open source ones
- dave7 6y agoThe Twoplustwo evaluator is open source ("GPL, use as you like" specifically) Third party repo: https://github.com/tangentforks/TwoPlusTwoHandEvaluator https://github.com/tangentforks/TwoPlusTwoHandEvaluator Original statement of license: https://forumserver.twoplustwo.com/showpost.php?p=1482536&postcount=125 https://forumserver.twoplustwo.com/showpost.php?p=1482536&po...
- GFuller 6y agoThis is actually a side-project of a side-project, so I wanted to have a go at building the algo myself for a bit of fun/learning. I’m using Ruby under the hood...
- Zanni 6y agoIf 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 https://projecteuler.net/problem=54
- im3w1l 6y agoThat'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.
- Zanni 6y agoThe wheel is excluded by the problem definition (or rather, not specifically included). The ace only counts as a high card here.
- im3w1l 6y agoFair 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.
- dragonwriter 6y ago> 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.
- MauranKilom 6y agoIt's not apparent to me which part of evaluating poker hands would need to be updated over time... Just rebuilding for new framework versions?
- tylerchilds 6y agoEvaluating quality source code: 1. Does it have a badge that says "build passing"? 2. Does it have a bunch of stars on GitHub? 3. Does it have a commit in the past week? If so, wrap that in an npm package and publish it. Otherwise, it's AbAnDoNwArE.
- muzakthings 6y agoFor Python I'd recommend: https://github.com/worldveil/deuces https://github.com/worldveil/deuces
- markc 6y agoHere's an implementation in Clojure that scores hands and selects a winner. It handles low vs high ace in straights. https://gist.github.com/mchampine/dca965226148dfd19d5e4d7f3d4600c5 https://gist.github.com/mchampine/dca965226148dfd19d5e4d7f3d... Most of it was done for a weekly Clojure programming challenge run by Eric Normand in his PurelyFunctional.tv newsletter. You can see all the entries at https://gist.github.com/ericnormand/fbc9b6386a66c1ece590930db07ac604 https://gist.github.com/ericnormand/fbc9b6386a66c1ece590930d...
- joeleong 6y agohttps://github.com/andrewprock/pokerstove https://github.com/andrewprock/pokerstove