Advertisement
Guest User

Craps Promo

a guest
Feb 25th, 2012
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub meh()
  2.     Dim shooter As Long
  3.     Dim trials As Long
  4.     Dim bWin As Boolean
  5.     Dim bOut7 As Boolean
  6.     Dim bComeOut As Boolean
  7.     Dim bJackpot As Boolean
  8.     Dim roll As Integer
  9.     Dim made As Integer
  10.     Dim jackpots As Long
  11.    
  12.     Randomize
  13.    
  14.     trials = 1000000
  15.    
  16.     For shooter = 1 To trials
  17.         bOut7 = False
  18.         bJackpot = False
  19.         made = 0
  20.         Do Until bOut7 'Move to next shooter after a 7 out
  21.            bComeOut = True
  22.             bWin = False
  23.             Do Until bWin Or bOut7
  24.                 'Roll the dice
  25.                roll = Int(6 * Rnd + 1) + Int(6 * Rnd + 1)
  26.                 If bComeOut Then
  27.                     If roll = 7 Or roll = 11 Then
  28.                         total = total + 5
  29.                     ElseIf roll = 2 Or roll = 3 Or roll = 12 Then
  30.                         total = total - 5
  31.                     Else 'Point established
  32.                        point = roll
  33.                         bComeOut = False
  34.                     End If
  35.                 ElseIf roll = point Then
  36.                     bWin = True
  37.                     total = total + 5
  38.                    
  39.                     made = made Or 2 ^ roll 'Made this point
  40.                    If made = 1904 Then
  41.                         If bJackpot = False Then
  42.                             total = total + 4000
  43.                             bJackpot = True
  44.                             jackpots = jackpots + 1
  45.                         End If
  46.                     End If
  47.                 ElseIf roll = 7 Then
  48.                     bOut7 = True
  49.                     total = total - 5
  50.                 End If
  51.             Loop
  52.         Loop
  53.     Next shooter
  54.    
  55.     Debug.Print "Total: " & total / trials & " Jackpots: " & jackpots
  56. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement