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
  #1  
Old 11-01-2007, 02:27 PM
iwannawon iwannawon is offline
Member
 
Join Date: Jun 2007
Posts: 71
Default troubleshoot vba code, icm for 4 prizes

i've been playing a lot of 2 table sngs that pay 4 places lately. i found one online calculator that can handle more than 3 prizes but i wanted my own offline version (excel). probably won't make sense here to just post code snippets but i can pm a file/link to anyone interested. just in case, here's the code to calculate 3rd place (working) but my code for 4th place is wrong. i'm not a programmer nor do i completely understand the math. thought i could figure it out as i went. 99% sure i don't have 'probability of j getting 2nd' defined correctly. i get different results when i test against the online version. if i try it using 3 places it matches. thanks.
<font class="small">Code:</font><hr /><pre>
'third place results (works)
For i = 1 To gbl_MAXPLAYERS 'i is first
If stacks(i) &gt; 0 Then
For j = 1 To gbl_MAXPLAYERS 'j is second
If j &lt;&gt; i And stacks(j) &gt; 0 Then
tempTotal = totalChips - stacks(i) - stacks(j)
For k = 1 To gbl_MAXPLAYERS 'k is third
If k &lt;&gt; i And k &lt;&gt; j Then
If tempTotal &lt;&gt; 0 Then
totalFinish(k)(3) = totalFinish(k)(3) + stacks(k) / tempTotal * totalFinish(i)(1) * stacks(j) / (tempTotal + stacks(j))
'Probability of k getting third times probability of i getting first times probability of j getting 2nd given i got first.
End If
End If
Next k
End If
Next j
End If
Next i


'fourth place results (not working)
For i = 1 To gbl_MAXPLAYERS 'i is first
If stacks(i) &gt; 0 Then
For j = 1 To gbl_MAXPLAYERS 'j is second
If j &lt;&gt; i And stacks(j) &gt; 0 Then
For k = 1 To gbl_MAXPLAYERS 'k is third
If k &lt;&gt; i And k &lt;&gt; j And stacks(k) &gt; 0 Then
For l = 1 To gbl_MAXPLAYERS 'l is fourth
If l &lt;&gt; i And l &lt;&gt; j And l &lt;&gt; k Then
tempTotal = totalChips - stacks(i) - stacks(j) - stacks(k)
If tempTotal &lt;&gt; 0 Then
totalFinish(l)(4) = totalFinish(l)(4) + stacks(l) / tempTotal * totalFinish(i)(1) * totalFinish(j)(2) * stacks(k) / (tempTotal + stacks(k))
'Probability of l getting forth times probability of i getting first times probability of j getting 2nd times probability of k getting 3rd given i got first.
End If
End If
Next l
End If
Next k
End If
Next j
End If
Next i
</pre><hr />
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 09:51 PM.


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