(no subject)

May 11, 2005 13:16

Guess who is going to comercia park on friday? Yes me. Why you ask? Not for the Tigers but for the Dirty Americans who will supossedly be playing before the game.
And Britany you are coming with me.



Option Explicit
Dim inttotalpoints As Integer

Private Sub cmddone_Click()
Unload Me
End Sub

Private Sub Form_Load()
Randomize
inttotalpoints = 100
End Sub
Private Sub cmdRollDice_Click()
Dim intRisk As Integer
Dim intDice1 As Integer, intDice2 As Integer, intTotal As Integer
intRisk = txtrisk.Text
intDice1 = RndInt(1, 6)
If intDice1 = 1 Then
picdice1.Picture = LoadPicture("Dice1.wmf")
ElseIf intDice1 = 2 Then
picdice1.Picture = LoadPicture("Dice2.wmf")
ElseIf intDice1 = 3 Then
picdice1.Picture = LoadPicture("Dice3.wmf")
ElseIf intDice1 = 4 Then
picdice1.Picture = LoadPicture("Dice4.wmf")
ElseIf intDice1 = 5 Then
picdice1.Picture = LoadPicture("Dice5.wmf")
ElseIf intDice1 = 6 Then
picdice1.Picture = LoadPicture("Dice6.wmf")
End If
intDice2 = RndInt(1, 6)
If intDice2 = 1 Then
picdice2.Picture = LoadPicture("Dice1.wmf")
ElseIf intDice2 = 2 Then
picdice2.Picture = LoadPicture("Dice2.wmf")
ElseIf intDice2 = 3 Then
picdice2.Picture = LoadPicture("Dice3.wmf")
ElseIf intDice2 = 4 Then
picdice2.Picture = LoadPicture("Dice4.wmf")
ElseIf intDice2 = 5 Then
picdice2.Picture = LoadPicture("Dice5.wmf")
ElseIf intDice2 = 6 Then
picdice2.Picture = LoadPicture("Dice6.wmf")
End If
intTotal = intDice1 + intDice2
If intTotal Mod 2 = 0 Then
inttotalpoints = inttotalpoints - intRisk
Else
inttotalpoints = inttotalpoints + (2 * intRisk)
End If
lblpoints.Caption = "Total points = " & inttotalpoints
End Sub

Function RndInt(ByVal intLowNumber As Integer, ByVal intHighNumber As Integer) As Integer
RndInt = Int((intHighNumber - intLowNumber + 1) * Rnd + intLowNumber)
End Function
Previous post Next post
Up