Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private _r As Integer = Nothing
- Private _r1 As Integer = Nothing
- Private Function calcBets(ByVal stake As Integer, ByVal ParamArray odds() As Integer)
- Dim r As Integer = 1
- _r = stake * (1 + odds(0)) ' We won't need to use the "stake" variable any other time, so we calculate that with the first odd first.
- val = _r ' Set the "val" property to the outcome of the calculations.
- Do While r <> UBound(odds) + 1 ' Do While "r" does not equal the amount of arguments supplied from the integer array of "odds".
- _r1 = val * (1 + odds(r)) ' Multiply the stored value of our first operation by the second operation.
- val = _r1 ' Set the value of "val" to our second operations outcome, this will continue in the loop indefinitely.
- r += 1 ' Increment the value of "r" so that we can continue "up" our array.
- Loop
- Return val ' Once the loop is done, return the final value.
- End Function
- Private _val As Integer = Nothing
- Private Property val As Integer
- Get
- Return _val
- End Get
- Set(value As Integer)
- _val = value
- End Set
- End Property
Advertisement
Add Comment
Please, Sign In to add comment