Archives

A Scriptable Equity Calculator

For all of your programming poker players out there, yesterday I made the Poker Sleuth Equity Calculator scriptable with bindings for C/C++, C#, and Python.

If you have easy_install or pip set up for Python, you can just do “easy_install pokersleuth”. It requires a 32-bit version of Python for Windows.

As an example, to compute the odds of winning when you have a pair of Jacks, your opponent has the Ace and 5 of diamonds, and the board cards are the 3 of diamonds, 5 of clubs, and 9 of diamonds:

>>> import pokersleuth
>>> pokersleuth.calculate_equity('3d5c9d', ('JJ', 'Ad5d')
[0.48225, 0.51775]

The module can also be used directly from the command line:

C:\>python -m pokersleuth 3d5c9d JJ Ad5d
[0.48225, 0.51775]

It supports up to 10 players and a quite extensive syntax for specifying hand ranges. Accuracy is within one percentage point with at least 99.5% probability.

Share

Comments are closed.