Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub meh()
- Dim shooter As Long
- Dim trials As Long
- Dim bWin As Boolean
- Dim bOut7 As Boolean
- Dim bComeOut As Boolean
- Dim bJackpot As Boolean
- Dim roll As Integer
- Dim made As Integer
- Dim jackpots As Long
- Randomize
- trials = 1000000
- For shooter = 1 To trials
- bOut7 = False
- bJackpot = False
- made = 0
- Do Until bOut7 'Move to next shooter after a 7 out
- bComeOut = True
- bWin = False
- Do Until bWin Or bOut7
- 'Roll the dice
- roll = Int(6 * Rnd + 1) + Int(6 * Rnd + 1)
- If bComeOut Then
- If roll = 7 Or roll = 11 Then
- total = total + 5
- ElseIf roll = 2 Or roll = 3 Or roll = 12 Then
- total = total - 5
- Else 'Point established
- point = roll
- bComeOut = False
- End If
- ElseIf roll = point Then
- bWin = True
- total = total + 5
- made = made Or 2 ^ roll 'Made this point
- If made = 1904 Then
- If bJackpot = False Then
- total = total + 4000
- bJackpot = True
- jackpots = jackpots + 1
- End If
- End If
- ElseIf roll = 7 Then
- bOut7 = True
- total = total - 5
- End If
- Loop
- Loop
- Next shooter
- Debug.Print "Total: " & total / trials & " Jackpots: " & jackpots
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement