|
-
Feb 20th, 2000, 06:26 AM
#1
Thread Starter
Junior Member
This is my slot machine that creates random number between 1 & 3. The problem it has is it doesn't save what you win. it is supposed to deduct a dollar each pull, and if it shows all 1's you getr $3, all 2's $6, and all 3's $10.
It is suppoed to show your total winnings in lbltotal.caption
Private Sub cmdpull_Click()
Dim intwin As Integer
intwin = -1
lbltotal.Caption = intwin
lbl1.Caption = Int(3 * Rnd + 1)
lbl2.Caption = Int(3 * Rnd + 1)
lbl3.Caption = Int(3 * Rnd + 1)
If lbl1.Caption = 1 And lbl2.Caption = 1 And lbl3.Caption = 1 Then
MsgBox "You won $3"
intwin = 3
ElseIf lbl1.Caption = 2 And lbl2.Caption = 2 And lbl3.Caption = 2 Then
MsgBox "You won $6"
intwin = 6
ElseIf lbl1.Caption = 3 And lbl2.Caption = 3 And lbl3.Caption = 3 Then
MsgBox "You won $10"
intwin = 10
End If
End Sub
-
Feb 20th, 2000, 06:30 AM
#2
New Member
from what I see right your program should be putting -1 in the caption all the time if that's what it does you have to move the caption to the bottom then it will print the winnings if you want it to continuously calculate then you have to use statements like
intwin = intwin + 10
or
intwin = intwin - 1
hope this helps
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|