Two Plus Two Newer Archives  

Go Back   Two Plus Two Newer Archives > Internet Gambling > Software
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #221  
Old 06-18-2007, 05:25 PM
hanhikoski hanhikoski is offline
Junior Member
 
Join Date: Jun 2007
Posts: 3
Default 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?
Reply With Quote
  #222  
Old 06-20-2007, 07:06 PM
RayW RayW is offline
Junior Member
 
Join Date: Mar 2005
Posts: 24
Default 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
Reply With Quote
  #223  
Old 08-05-2007, 04:43 AM
bokeh bokeh is offline
Junior Member
 
Join Date: Aug 2007
Posts: 1
Default 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
Reply With Quote
  #224  
Old 08-07-2007, 11:52 AM
Masterplan Masterplan is offline
Member
 
Join Date: Aug 2006
Posts: 46
Default 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(&amp;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?
Reply With Quote
  #225  
Old 08-08-2007, 06:55 PM
RayW RayW is offline
Junior Member
 
Join Date: Mar 2005
Posts: 24
Default 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(&amp;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...
Reply With Quote
  #226  
Old 08-09-2007, 11:51 AM
jukofyork jukofyork is offline
Senior Member
 
Join Date: Sep 2004
Location: Leeds, UK.
Posts: 2,551
Default 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(&amp;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]
Reply With Quote
  #227  
Old 08-18-2007, 12:01 AM
Janis N. Janis N. is offline
Senior Member
 
Join Date: Jul 2007
Posts: 527
Default 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.
Reply With Quote
  #228  
Old 08-18-2007, 06:54 AM
advis0r advis0r is offline
Member
 
Join Date: Apr 2007
Location: Southern Germany
Posts: 99
Default 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]
Reply With Quote
  #229  
Old 08-23-2007, 12:00 PM
Masterplan Masterplan is offline
Member
 
Join Date: Aug 2006
Posts: 46
Default 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
Reply With Quote
  #230  
Old 08-23-2007, 02:03 PM
Al P Al P is offline
Senior Member
 
Join Date: Jan 2005
Location: Weighed down in the Undertow
Posts: 796
Default Re: 7 Card Hand Evaluators

Hey are there any evaluators out there that stop on the flop (5 cards)?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:53 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.