Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub venti_odds()
- '
- 'odds and probability values
- Dim total_rolls As Long: total_rolls = 10000000 'total rolls to simulate
- Dim venti_odds As Single: venti_odds = 0.5 'chance of getting venti (initially)
- Dim venti_pity As Single: venti_pity = 2 'psuedo pity garauntee for getting venti
- Dim rand As Single
- 'start counters at 0
- Dim nonboost As Long: nonboost = 0
- Dim venti As Long: venti = 0
- Dim ventistreak As Integer: ventistreak = 0
- Dim nat_venti As Long: nat_venti = 0
- Dim pity_venti As Long: pity_venti = 0
- For i = 1 To total_rolls
- 'randomize roll
- rand = Rnd()
- 'if pity venti
- If ventistreak >= venti_pity - 1 Then
- pity_venti = pity_venti + 1
- venti = venti + 1
- ventistreak = 0
- 'if natural venti
- ElseIf rand <= venti_odds Then
- nat_venti = nat_venti + 1
- venti = venti + 1
- ventistreak = 0
- 'else random 5*
- Else
- nonboost = nonboost + 1
- ventistreak = ventistreak + 1
- End If
- 'next roll
- Next i
- 'export results into spreadsheet
- Cells(15, 2).Value = venti 'total venti pulls
- Cells(15, 3).Value = nonboost 'total non boosted character pulls
- Cells(15, 4).Value = nat_venti 'total natural Venti pulls
- Cells(15, 5).Value = pity_venti 'total pity venti pulls
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement