jamin on August 25th, 2004

I was bored last night, and so I wrote a quick hack. If you’ve ever watched Texas Holdem on TV (e.g. The World Series of Poker on ESPN), you’ve no doubt seen the percentages next to the hands that the computer generates. I find that kind of data helpful, so I wrote a quick-n-dirty frontend to poker-eval, a c-based library for poker hand evaluation. At first I wanted to either port the library to C# or at least make some C# bindings but I found the code rather difficult to read and my C skills are somewhat lacking. So I just wrote a front-end to a command-line program that ships with the library called “pokenum.” Here’s the result:



The interesting thing about the pokenum utility is that it doesn’t just generate a bunch of random hands. It actually enumerates every possible board and counts the wins, losses, and ties. So the percentages it spits out are supposed to be exact.

Tags:

10 Responses to “Texas Holdem Percentages”

  1. Your percentages don’t add up to 100% :)

  2. furthermore, when has K been Jack?
    where’s the bugzilla for this project?

  3. This looks cool. I started writing a similar gui for poker-eval with some of the card images and code from gnome-games, but never got around to finishing it. It would be useful also to allow the user to set the flop and turn cards as well.

    Frederico: those percentages are the win percentages, and they dont add to 100 as there is a chance the hands could tie :)

  4. Federico:
    Okay, as Mike pointed out the percentages are the win percentages. Sometimes the hands tie and the pot is split.

    Mike:
    I also plan on adding the ability to put in board cards…So you can calculate what your chance of winning on the turn or river is.

    Random Dude:
    Thank you. I wrote this in like 30 minutes. I obviously missed that.

  5. A good poker odds calculator can be found on cardplayer.com, only theirs has a nice GUI that lets you click cards for each player and/or board and/or turn.

    They simulate the boards (instead of enumerating them) but seem to do a fair amount of them to ensure enough accuracy. Re-simulate a dozen times and you’ll find only a few hundreths of a percent difference.

    These odds calculators are best used to analyze your play on key hands after the event, it’s impossible or very difficult to use them during play itself. TV commentary is given the benefit of taping after the hand/event, ESPN being an example for it’s months of lag between the live WSOP (ended May 28th) and the coverage that will continue to air new shows through September.

    Lastly, when/where will one see some source for this tool?

  6. I’ll clean up the source a bit, add the ability to put down board cards and dead cards and release it under an open source license soon.

  7. Travelers from Google: If this post wasn’t what you were looking for when searching on google for “holdem percentages” you might check out the hand simulator which is a web front-end to the very same program I used, pokenum. Very handy.

  8. It would be nice to have a brief guide of how to compile it. I don’t compile other stuff than C/C++ and FORTRAN. so…

  9. If you can help me, in the next day or two, figure out how to adapt poker-eval to my needs (either on the phone or by email), i will pay you 200 dollars. let me know…

    Justin

  10. Did you do this on *nix what would be required to replicate on windows?