Re: 7 Card Hand Evaluators
Hi Steve!!
[ QUOTE ]
h |= ((Hand_T)1 << deck[r]);
[/ QUOTE ]
Interesting you had this outside the eval routine... The equivelent statement for me is:
<font class="small">Code:</font><hr /><pre> h = HR[h + deck[r]]; </pre><hr />
Please initialize h to 53 before the beginning of the hand loop. The lookup loop for me will be:
<font class="small">Code:</font><hr /><pre> handTypeSum[hands[i] >> 12]++; </pre><hr />
I think you will find that this might be a little quicker... [img]/images/graemlins/wink.gif[/img]
Of course if this isn't a good alternative, put the hand init (quoted code above) into the same for loop in the eval section, I think you will find similar results. I think the for loop inside the eval area is definitely a killer in this...
Either way, even if there really was a speed difference (and I don't think it is as big as it looks), how often would you do a million random hands? If you had to do them, would the half a sec make a big difference? How does your evaluator do for the big enumerations (that at least I seem to always be running)?
What evaluator did you use to do the comparison?
Thank you for the info, definitely had something interesting there...
Ray...
|