Results 1 to 2 of 2

Thread: Slot Machine

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Posts
    18

    Post

    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

  2. #2
    New Member
    Join Date
    Feb 2000
    Posts
    4

    Post

    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
  •  



Click Here to Expand Forum to Full Width