Show HN: A simple Poker API to calculate the winning hand/s
pokerapi.dev
pokerapi.dev
Running the calculations in your head isn't hard. You can get it with practice and it's an obvious step for being a good poker player.
There's a huge difference in quality of players in virtual gaming vs "B&M" (bricks and mortar, or playing face to face.) The world mourned the poker scene after Black Friday because the market for horrible players with money to blow disappeared. This left the hard core grinders with nobody to fish but each other. I suppose this would be much like potential competition in a world of WFH vs requiring your presence in one of the most expensive cities in the world.
There's still lots of horrible players in B&M games. You can do okay with just a gut feel for the calculations in these games. A lot of players like to gamble. It depends on the level of the game. As the blinds climb, the game gets harder.
I started playing one table at a time, then two and ended up at 4 (6max NL holdem). One thing that always bothered me, especially when the HUDs + pokertracker became necessities, was that no poker site allowed you to switch usernames in order to nullify playing history that your opponents had accumulated.
Eventually, this ruined the game for me as it completely changed the dynamics and took away a lot of possibilities and excitement. I also saw limit holdem be completely destroyed by algorithms and bots, long before it became so obvious that most stopped playing it altogether. I don't play these days but I'm wondering as to what extent shorthanded NL is being algorithmically exploited.
When I finally finished I was asked to add Stud, Badeucy and Badacey. That’s when I quit.
But no, I think the class structure worked well for this. Just too many esoteric rules in these games. And it’s getting worse from what I hear of the high stakes games. Archey was just getting popular when I quit and now there is like a half dozen new games they play. It’s a constant arms race to see who can master a new set of rules to skin the fish with.
The Hand object has a method that returns Card objects by index with a high to low order so subclasses can do their comparisons in either 4 or 5 card games.
The you need like a best hand method, so games like Holdem that make best 5 card hands out of 7 cards work. Then a bunch of utility functions.
It’s also useful to have your Card objects have their comparison functions.
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.
Third party repo: https://github.com/tangentforks/TwoPlusTwoHandEvaluator
Original statement of license: https://forumserver.twoplustwo.com/showpost.php?p=1482536&po...
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).
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.
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.
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/fbc9b6386a66c1ece590930d...
The main idea was to do monte-carlo simulations and give you your odds of winning at any point in the game by dealing random cards for the unknowns.
Interesting read on that and other evaluators as well:
http://web.archive.org/web/20130116102452/http://www.codingt...
Anyway, I got at least one "game" done, you need to correctly count your outs. It is not perfect but covers most cases well.
I kind of want to take your 50 line challenge however :) I always loved playing poker, might be a fun exercise.
The flop requires slightly more power to execute, but many tools do this in a small amount of time so I guess it’s feasible.