Jayme Fishman - 2008-04-04 02:06:50 -
In reply to message 1 from AMBA
I could not agree more. It is HUGE. It was the first thing that I ever wrote (and I am self taught which is why it is not very good) ... and I don't mess around with this stuff very much. However, I did just write another poker engine that is 10% of the size of this one in a client side scripting language called "autoit." I may port that code to PHP since it is much more efficient. Example, the code below is used to find a pair and all three kickers. If you look in the PHP code it is hundreds of lines. If I have time I will release a new version that is much easier to maintain/use and MUCH smaller.
Func findTwo($cardCount)
dim $findCounter ; used in the for loop
dim $innerWhileCounter =1 ; used in the while loop
dim $decimalPlace = .01 ; used for kicker score
$ccPosition =12
for $findCounter = 12 to 0 Step -1
if $cardCount[$ccPosition] = 2 Then
$text = "Pair"
$points = ($ccPosition * 2) + 1000
dim $startPos2 = 12
while $innerWhileCounter <4
If $cardCount[$startPos2] = 1 then
$kickerScore += $startPos2 * $decimalPlace
;MsgBox("","KickerScore is: ", $kickerScore) - Debug Code
$innerWhileCounter += 1
$decimalPlace *= .01
EndIf
$startPos2 -= 1
WEnd
return True
EndIf
$ccPosition -=1
Next
EndFunc