#221
|
|||
|
|||
Re: 7 Card Hand Evaluators
The reason to register. Thank you. I'd like to thank the guys at the UofA, poker source developers and the contributors in this thread.
Ran Ray Wotton's nested loop hand type enumeration test (TestHandRank.cpp) on a dual-core 2.00 GHz windows laptop. Compiled as a console application and with Maximize speed and Favor Fast Code compiler options in VS.Net 2005. Got some weird results: BAD!! = 0 High Card = 23294460 Pair = 58627800 Two Pair = 31433400 Three of a Kind = 6461620 Straight = 6180020 Flush = 4047644 Full House = 3473184 Four of a Kind = 224848 Straight Flush = 41584 Total Hands = 133784560 Validation seconds = 1.0940 Total HighPrecision Clocks = 3923457 HighPrecision clocks per lookup = 0.029327 This is quite far from what I should be getting. Ideas? |
#222
|
|||
|
|||
Re: 7 Card Hand Evaluators
Hi,
I see that you have the right answers, well that is a good start. Since you have the 2005 version, try to instrument the code and optimize it. That should speed it up. You might want to select the proper CPU and other optimizations in the project settings (I am using the AMD64 dual processor). Honestly getting the 130+ million hands evaled in a second is a great accomplishment in itself! Ray |
#223
|
|||
|
|||
Re: 7 Card Hand Evaluators
Hi friends, I'm new round here!
I've written an extremely simple and fast 7 card evaluator in PHP which can be seen in action at texas.holdem.poker.probability.cal.culator.org The evaluator function takes an un-ordered hand array('AH', '5H', '4H', '9C', 'TC', '2D', '3H') runs <font color="red">five very simple lines of code</font> and returns an integer ("1" Royal Flush thru "7414" Nine High "98754" which is the worst hand it is possible to form from 7 cards). There are a couple of simple look-up tables and the RAM footprint is in the region of 4.3 megabytes. I personally don't know C/C++ but would be very interested in sharing my code with anyone that would like to port it into a CLI in C/C++ along with the simulate function. My email |
#224
|
|||
|
|||
Re: 7 Card Hand Evaluators
been trying to get Ray's code to work as part of my Msc project (very useful!)
but am failing horribly. wirth a few subtle modifications to get it to run on visual studio 2005 i got the HandRankSetup to work fine. Getting Card IDs! ID - 612976 Setting HandRanks! ID - 612976 Number IDs = 612977 maxHR = 32487833 Training seconds = 61.54 BAD!! = 0 High Card = 23294460 Pair = 58627800 Two Pair = 31433400 Three of a Kind = 6461620 Straight = 6180020 Flush = 4047644 Full House = 3473184 Four of a Kind = 224848 Straight Flush = 41584 Total Hands = 133784560 Validation seconds = 0.6250 Total HighPrecision Clocks = 2225124 HighPrecision clocks per lookup = 0.016632 however, i cannot get TestHandRank to run properly. i've converted: FILE * fin = fopen("..\\HandRanks.dat", "rb"); to FILE * fin; fopen_s(&fin,"..\\HandRanks.dat", "rb"); but this just doesnt find the file (in the same directory) so i change the ..\\ to .\\ and i get: BAD!! = 133784560 High Card = 0 Pair = 0 Two Pair = 0 Three of a Kind = 0 Straight = 0 Flush = 0 Full House = 0 Four of a Kind = 0 Straight Flush = 0 Total Hands = 133784560 Validation seconds = 0.5000 Total HighPrecision Clocks = 1787357 HighPrecision clocks per lookup = 0.013360 which is just entirely confusing. any ideas anyone? |
#225
|
|||
|
|||
Re: 7 Card Hand Evaluators
[ QUOTE ]
been trying to get Ray's code to work as part of my Msc project (very useful!) but am failing horribly. wirth a few subtle modifications to get it to run on visual studio 2005 i got the HandRankSetup to work fine. Getting Card IDs! ID - 612976 Setting HandRanks! ID - 612976 Number IDs = 612977 maxHR = 32487833 Training seconds = 61.54 BAD!! = 0 High Card = 23294460 Pair = 58627800 Two Pair = 31433400 Three of a Kind = 6461620 Straight = 6180020 Flush = 4047644 Full House = 3473184 Four of a Kind = 224848 Straight Flush = 41584 Total Hands = 133784560 Validation seconds = 0.6250 Total HighPrecision Clocks = 2225124 HighPrecision clocks per lookup = 0.016632 however, i cannot get TestHandRank to run properly. i've converted: FILE * fin = fopen("..\\HandRanks.dat", "rb"); to FILE * fin; fopen_s(&fin,"..\\HandRanks.dat", "rb"); but this just doesnt find the file (in the same directory) so i change the ..\\ to .\\ and i get: BAD!! = 133784560 High Card = 0 Pair = 0 Two Pair = 0 Three of a Kind = 0 Straight = 0 Flush = 0 Full House = 0 Four of a Kind = 0 Straight Flush = 0 Total Hands = 133784560 Validation seconds = 0.5000 Total HighPrecision Clocks = 1787357 HighPrecision clocks per lookup = 0.013360 which is just entirely confusing. any ideas anyone? [/ QUOTE ] Well, by the looks of it you have the hard part done. I use the VS2005 myself, so you shouldn't have too much trouble. Obviously it can't find the file... Perhaps if you look to see where it is on your hard drive and point to it directly. instead of the : FILE * fin = fopen("..\\HandRanks.dat", "rb"); use: FILE * fin = fopen("c:\\directory\\path\\you\\founditin\\HandRa nks.dat", "rb"); if (!fin) printf("I Missed it Again!!"); // if you see this message, you still aren't opening the file! Have a Great Day!! Ray... |
#226
|
|||
|
|||
Re: 7 Card Hand Evaluators
[ QUOTE ]
[ QUOTE ] been trying to get Ray's code to work as part of my Msc project (very useful!) but am failing horribly. wirth a few subtle modifications to get it to run on visual studio 2005 i got the HandRankSetup to work fine. Getting Card IDs! ID - 612976 Setting HandRanks! ID - 612976 Number IDs = 612977 maxHR = 32487833 Training seconds = 61.54 BAD!! = 0 High Card = 23294460 Pair = 58627800 Two Pair = 31433400 Three of a Kind = 6461620 Straight = 6180020 Flush = 4047644 Full House = 3473184 Four of a Kind = 224848 Straight Flush = 41584 Total Hands = 133784560 Validation seconds = 0.6250 Total HighPrecision Clocks = 2225124 HighPrecision clocks per lookup = 0.016632 however, i cannot get TestHandRank to run properly. i've converted: FILE * fin = fopen("..\\HandRanks.dat", "rb"); to FILE * fin; fopen_s(&fin,"..\\HandRanks.dat", "rb"); but this just doesnt find the file (in the same directory) so i change the ..\\ to .\\ and i get: BAD!! = 133784560 High Card = 0 Pair = 0 Two Pair = 0 Three of a Kind = 0 Straight = 0 Flush = 0 Full House = 0 Four of a Kind = 0 Straight Flush = 0 Total Hands = 133784560 Validation seconds = 0.5000 Total HighPrecision Clocks = 1787357 HighPrecision clocks per lookup = 0.013360 which is just entirely confusing. any ideas anyone? [/ QUOTE ] Well, by the looks of it you have the hard part done. I use the VS2005 myself, so you shouldn't have too much trouble. Obviously it can't find the file... Perhaps if you look to see where it is on your hard drive and point to it directly. instead of the : FILE * fin = fopen("..\\HandRanks.dat", "rb"); use: FILE * fin = fopen("c:\\directory\\path\\you\\founditin\\HandRa nks.dat", "rb"); if (!fin) printf("I Missed it Again!!"); // if you see this message, you still aren't opening the file! Have a Great Day!! Ray... [/ QUOTE ] Just on the off-chance that you are trying to compile this under Unix then you should also make sure that you use forward slashes instead (eg: "//") - most windoze compilers (and Java VM) still work with forward slashes, but backslahes tend to regularly cause porting problems. Juk [img]/images/graemlins/smile.gif[/img] |
#227
|
|||
|
|||
Re: 7 Card Hand Evaluators
I tried to compile poker-eval on windows/cygwin as a .dll in order to use from JNI and failed.
If anybody has managed to do that, please drop me a PM. |
#228
|
|||
|
|||
Re: 7 Card Hand Evaluators
[ QUOTE ]
I tried to compile poker-eval on windows/cygwin as a .dll in order to use from JNI and failed. If anybody has managed to do that, please drop me a PM. [/ QUOTE ] when i tried that i failed too [img]/images/graemlins/smile.gif[/img] since then i have been using a modified version of steve brecher's holdem showdown http://www.brecware.com/Software/software.html if you find a way to create the dll plz drop me pm [img]/images/graemlins/smile.gif[/img] |
#229
|
|||
|
|||
Re: 7 Card Hand Evaluators
[ QUOTE ]
Well, by the looks of it you have the hard part done. I use the VS2005 myself, so you shouldn't have too much trouble. Obviously it can't find the file... Perhaps if you look to see where it is on your hard drive and point to it directly. instead of the : FILE * fin = fopen("..\\HandRanks.dat", "rb"); use: FILE * fin = fopen("c:\\directory\\path\\you\\founditin\\HandRa nks.dat", "rb"); if (!fin) printf("I Missed it Again!!"); // if you see this message, you still aren't opening the file! Have a Great Day!! Ray... [/ QUOTE ] found the problem. for some reason the write in HandRankSetup failed if it was over a certain size. so i split the HR array into 2 parts and wrote them a part at a time. BAD!! = 0 High Card = 23294460 Pair = 58627800 Two Pair = 31433400 Three of a Kind = 6461620 Straight = 6180020 Flush = 4047644 Full House = 3473184 Four of a Kind = 224848 Straight Flush = 41584 Total Hands = 133784560 Validation seconds = 0.6090 Total HighPrecision Clocks = 2230899 HighPrecision clocks per lookup = 0.016675 done [img]/images/graemlins/smile.gif[/img] thanks again for the awesome evaluator code |
#230
|
|||
|
|||
Re: 7 Card Hand Evaluators
Hey are there any evaluators out there that stop on the flop (5 cards)?
|
|
|