Advertisement
Guest User

Untitled

a guest
Mar 1st, 2012
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Option Explicit
  2.  
  3. Sub RunSim()
  4.     Call BettingTwoDozensAtOneUnit
  5.     Call BettingOneDozenAtTwoUnits
  6.     Call BettingFirst18AtTwoUnits
  7. End Sub
  8. Sub BettingTwoDozensAtOneUnit()
  9.     Dim session As Long
  10.     Dim sessions As Long
  11.     Dim spin As Long
  12.     Dim spinsPerSession As Byte
  13.     Dim winLoss As Long
  14.     Dim bet As Byte
  15.     Dim totalBets As Long
  16.    
  17.     Randomize
  18.    
  19.     sessions = 1000000
  20.     spinsPerSession = 120 '3 hours at 40 spins per hour
  21.    
  22.     For session = 1 To sessions
  23.         bet = 2
  24.         For spin = 1 To spinsPerSession
  25.             'Increase the handle (total bets placed) by bet
  26.            totalBets = totalBets + bet
  27.             If Int((36 + 1) * Rnd) <= 12 Then 'Lose on zero or first dozen
  28.                winLoss = winLoss - 2 'Lose 2 units
  29.            Else 'Win on any other number
  30.                winLoss = winLoss + 1 'Win 1 unit
  31.            End If
  32.         Next spin
  33.     Next session
  34.    
  35.     Debug.Print "2Dozens - Average Bet: " & totalBets / (sessions * spinsPerSession)
  36.     Debug.Print "2Dozens - Win per Session: " & winLoss / sessions
  37.     Debug.Print "2Dozens - Loss Per Unit Bet: " & winLoss / (totalBets)
  38. End Sub
  39.  
  40. Sub BettingOneDozenAtTwoUnits()
  41.     Dim session As Long
  42.     Dim sessions As Long
  43.     Dim spin As Long
  44.     Dim spinsPerSession As Byte
  45.     Dim winLoss As Long
  46.     Dim bet As Byte
  47.     Dim totalBets As Long
  48.    
  49.     Randomize
  50.    
  51.     sessions = 1000000
  52.     spinsPerSession = 120 '3 hours at 40 spins per hour
  53.    
  54.     For session = 1 To sessions
  55.         bet = 2
  56.         For spin = 1 To spinsPerSession
  57.             'Increase the handle (total bets placed) by bet
  58.            totalBets = totalBets + bet
  59.             If Int((36 + 1) * Rnd) <= 24 Then 'Lose on zero or first dozen or second dozen
  60.                winLoss = winLoss - 2 'Lose 2 units
  61.            Else 'Win on any other number
  62.                winLoss = winLoss + 4 'Win 4 units
  63.            End If
  64.         Next spin
  65.     Next session
  66.    
  67.     Debug.Print "1Dozen - Average Bet: " & totalBets / (sessions * spinsPerSession)
  68.     Debug.Print "1Dozen - Win per Session: " & winLoss / sessions
  69.     Debug.Print "1Dozen - Loss Per Unit Bet: " & winLoss / (totalBets)
  70. End Sub
  71.  
  72. Sub BettingFirst18AtTwoUnits()
  73.     Dim session As Long
  74.     Dim sessions As Long
  75.     Dim spin As Long
  76.     Dim spinsPerSession As Byte
  77.     Dim winLoss As Long
  78.     Dim bet As Byte
  79.     Dim totalBets As Long
  80.    
  81.     Randomize
  82.    
  83.     sessions = 1000000
  84.     spinsPerSession = 120 '3 hours at 40 spins per hour
  85.    
  86.     For session = 1 To sessions
  87.         bet = 2
  88.         For spin = 1 To spinsPerSession
  89.             'Increase the handle (total bets placed) by bet
  90.            totalBets = totalBets + bet
  91.             If Int((36 + 1) * Rnd) <= 18 Then 'Lose on zero or the first 18
  92.                winLoss = winLoss - 2 'Lose 2 units
  93.            Else 'Win on any other number
  94.                winLoss = winLoss + 2 'Win 4 units
  95.            End If
  96.         Next spin
  97.     Next session
  98.    
  99.     Debug.Print "19to36 - Average Bet: " & totalBets / (sessions * spinsPerSession)
  100.     Debug.Print "19to36 - Win per Session: " & winLoss / sessions
  101.     Debug.Print "19to36 - Loss Per Unit Bet: " & winLoss / (totalBets)
  102. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement