Open Side Menu Go to the Top
Register
PokerStove source code ? PokerStove source code ?

08-20-2011 , 01:20 PM
Hi !

Could someone give me the source code of a program like PokerStove, please ?

Programing language doesn't matter ! I want to use ti to create an excel spreadsheed like that.


Thanks !
PokerStove source code ? Quote
08-20-2011 , 03:28 PM
http://www.codeproject.com/KB/game/p...ndevaldoc.aspx
http://www.codeproject.com/KB/game/M...Analysis1.aspx

Not pokerstove exactly but might give you some ideas. The only open code that I've come across. If you find anything else, please post a link.
PokerStove source code ? Quote
08-21-2011 , 12:30 AM
Quote:
Originally Posted by myNameIsInga
The only open code that I've come across. If you find anything else, please post a link.
LOL was just re-reading this, last tab closed! absolutely excellent article covering many source codes: http://www.codingthewheel.com/archiv...luator-roundup

one of the best 2+2 threads ever (if you like this sort of thing lol) http://forumserver.twoplustwo.com/45...valuators-597/

There is no actual PokerStove source code, HoldemRanger however, a similar app was available with source code but the site's been down for a while now. I just tried checking but I can't confirm, I don't remember what the license was so if I should re-upload it
PokerStove source code ? Quote
08-21-2011 , 05:42 AM
I have seen those links too, thats hand evaluators not equity calculators. so if you are looking for equity calc source code those links wont do it for you, but certainly great links if you want to build one! Love that 2p2 thread!
PokerStove source code ? Quote
08-21-2011 , 10:26 AM
First thread I ever made on 2+2

Pokerstove is closed source, and when I tried to contact them about it they wouldn't really tell me their methodology, which is fine, it's their code! They did hint to me it was a table based approach (you can do smart 2 birds with 1 stone stuff with table arithmetic).
PokerStove source code ? Quote
08-21-2011 , 11:52 AM
http://forumserver.twoplustwo.com/45...brary-1081197/

There is some discussion of how pokerstove does it in that thread
PokerStove source code ? Quote
08-22-2011 , 11:19 AM
Is it possible to integrate pokerstove in another (java) program?
PokerStove source code ? Quote
08-22-2011 , 12:50 PM
The pokerstove code isn't open so I dont think there is an easy way of doing it.
PokerStove source code ? Quote
08-23-2011 , 03:46 PM
The poker evaluator gives you the option to either enumerate all or use Monty Carlo.

So....

Brute Force enumeration:

http://en.wikipedia.org/wiki/Brute-force_search

and Monty Carlo Simulation:

http://en.wikipedia.org/wiki/Monte_Carlo_method

It's counter-intuitive, but MC is more accurate than BF.

Good Luck. Monty Carlo sims are no fun to do, IMO.
PokerStove source code ? Quote
08-23-2011 , 04:01 PM
Quote:
It's counter-intuitive, but MC is more accurate than BF.
wat
PokerStove source code ? Quote
08-23-2011 , 06:19 PM
that makes no sense at all to me... An exhaustive enumeration should give the theoretically true result.

And why would monte carlo be hard?

Mvh
Inga
PokerStove source code ? Quote
08-24-2011 , 07:32 AM
BF is the actual answer so by definition is the most accurate answer. After a few million iterations however of random samples I found the numbers converged to the BF answer very precisely (within a tenth of a percent of so IIRC) and these numbers not only are far quicker to generate but also for all practical intents and purposes are as good as the BF answer. The chance of being >1% out on a result using random samples over a decent size is very remote.

BF does give the perfect answer, I think if two expert bots are put together one used random sampling and one use BF the BF one over millions of hands would have an edge.

At the moment random samples is the only way to generate PF odds for more than 2 players (maybe 3 nowadays), the number of flop/turn/river combos * player hand combos is just incalculably huge.
PokerStove source code ? Quote
08-26-2011 , 11:59 PM
my question is:
how does pokerstove tell me the odds of AA vs KK vs 33 over a sample of 296 082 864 games in 0.228 seconds ?

clearly it doesn't simulate all those games, so what's the basic idea ?
PokerStove source code ? Quote
08-27-2011 , 01:04 AM
for hu its trivial. say range I vs J. its some sum p_ij e_ij where p is the probability and e is the equity. we store e_ij in a table. we get p_ij = (w_ij / sum(w_ij) ) where the weight w_ij is from a very small table. competent coder can code this problem easily.

for n player you have to do clever suit isomorphisms when enumerating through all 5 card boards, or exhaust is too slow. so first, have on hand some quick 7 card eval. then, to do this, basically consider boards with no flush first, then boards with flush possible. to this end; bucket by pairs. so xxxxy is one bucket, xxxyy is another, xxxyz is another, xxyyz is another, xxwyz is another, uwxyz is the last. for each one there are only so many possibilities for a flush. example if the board is in the xxyyz case, for example KKQQ9, if theres a flush you can assume the first k, first q, and first 9 all have the same suit. in the xxwyz one there are 5 flush cases (wxy,wxz,wyz,xyz,wxyz), etc.
PokerStove source code ? Quote
08-27-2011 , 01:29 AM
pokerstove probably has lookup tables for three way preflop in addition to HU. IIRC Juk did 3way lookups for his SNG luck EV program?
PokerStove source code ? Quote
08-27-2011 , 01:33 AM
Quote:
Originally Posted by myNameIsInga
... thats hand evaluators not equity calculators. so if you are looking for equity calc source code those links wont do it for you ...
To be fair though an evaluator is only a tiny little step away from an equity calculator. wrap an evaluator in a loop, tally the results and there we go it's an equity calculator

Last edited by _dave_; 08-27-2011 at 01:34 AM. Reason: for the benefit of others reading, I know you likely know this already
PokerStove source code ? Quote
08-27-2011 , 04:01 AM
Quote:
Originally Posted by _dave_
To be fair though an evaluator is only a tiny little step away from an equity calculator. wrap an evaluator in a loop, tally the results and there we go it's an equity calculator
yes but not fast enough, as i said in my post you need to do suit isos or its too slow

cheers
PokerStove source code ? Quote
08-27-2011 , 04:07 AM
Quote:
Originally Posted by _dave_
pokerstove probably has lookup tables for three way preflop in addition to HU.
A 3way lookup table is going to be several hundred megabytes in size, but the Pokerstove install is only about 4MB... so I dont think this is true.
PokerStove source code ? Quote
08-27-2011 , 06:04 AM
Quote:
Originally Posted by _dave_
To be fair though an evaluator is only a tiny little step away from an equity calculator. wrap an evaluator in a loop, tally the results and there we go it's an equity calculator
Yes I know and I just did exactly that just because of this thread! Unfortunately every now and the my numbers are off by half a percentage point or so...

What would be the main cause for something like that given that it works most of the time, and the numbers are only off by a small amount?

Mvh
Inga
PokerStove source code ? Quote
08-27-2011 , 06:06 AM
Quote:
Originally Posted by Double Ice
yes but not fast enough, as i said in my post you need to do suit isos or its too slow

cheers
If its not look up, its probably doing math rather than doing the actual simulation. Ask the question in the math forum or probability forum, they might know how to calc that.
PokerStove source code ? Quote
08-27-2011 , 07:45 AM
When I looked at it I was pretty sure it was simulating it but killing 2 birds with 1 stone with some matrix arithmetic
PokerStove source code ? Quote
08-27-2011 , 08:56 AM
Poker Stove and other similar programs don't "calculate" equity using some magic math or formula. That's impossible with poker hands. They way these programs work is to simply count wins, losses and ties while enumerating every possible hand matchup (or a random sample of them for monte carlo).

Creating a lookup table just for heads-up preflop takes 1.76 million lines, before even trying to account for dead cards or more opponents, and isn't at all practical. The time to do a realtime full enumeration for a heads-up matchup is measured in milliseconds anyway.

I prefer the java code in Brecher's hand evaluator and have used it in my own programs, but just reviewing that or one of the other open source programs will show you how to do it. The "Coding The Wheel" link given in post #3 is the place to start.

Last edited by spadebidder; 08-27-2011 at 09:13 AM.
PokerStove source code ? Quote
08-27-2011 , 09:27 AM
Quote:
Originally Posted by spadebidder
Poker Stove and other similar programs don't "calculate" equity using some magic math or formula. That's impossible with poker hands. They way these programs work is to simply count wins, losses and ties while enumerating every possible hand matchup (or a random sample of them for monte carlo).

Creating a lookup table just for heads-up preflop takes 1.76 million lines, before even trying to account for dead cards or more opponents, and isn't at all practical. The time to do a realtime full enumeration for a heads-up matchup is measured in milliseconds anyway.

I prefer the java code in Brecher's hand evaluator and have used it in my own programs, but just reviewing that or one of the other open source programs will show you how to do it. The "Coding The Wheel" link given in post #3 is the place to start.
I'm sorry, but this is wrong, for head up scenarios pokerstove and maybe some other calculators as well, use look up tables and math to get the numbers much faster than a simulation run ever could.

Have a look at this link http://forumserver.twoplustwo.com/45...brary-1081197/
PokerStove source code ? Quote
08-27-2011 , 09:37 AM
Quote:
Originally Posted by myNameIsInga
I'm sorry, but this is wrong, for head up scenarios pokerstove and maybe some other calculators as well, use look up tables and math to get the numbers much faster than a simulation run ever could.

Have a look at this link http://forumserver.twoplustwo.com/45...brary-1081197/
Nope, that isn't what Poker Stove does for exact hands, or Brecher, or the big open source project (forget the name) that most code is based on. They do full enumeration for exact hands. The lookup table in that thread is for approximations using 169 suitless hands and not 1326 exact hands. The accuracy suffers by up to about 1% equity depending on suit domination.

An enumeration is not a simulation. Trust me, full enumeration of heads-up with two exact suited hands (1.7 million boards), takes a fraction of a second. I've used the code, I'm not speculating.

Last edited by spadebidder; 08-27-2011 at 09:44 AM.
PokerStove source code ? Quote

      
m