Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents lblSlot1 As System.Windows.Forms.Label
Friend WithEvents lblSlot2 As System.Windows.Forms.Label
Friend WithEvents lblSlot3 As System.Windows.Forms.Label
Friend WithEvents lblTokens As System.Windows.Forms.Label
Friend WithEvents btnPull As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.lblSlot1 = New System.Windows.Forms.Label
Me.lblSlot2 = New System.Windows.Forms.Label
Me.lblSlot3 = New System.Windows.Forms.Label
Me.lblTokens = New System.Windows.Forms.Label
Me.btnPull = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'lblSlot1
'
Me.lblSlot1.Font = New System.Drawing.Font("Microsoft Sans Serif", 36.0!)
Me.lblSlot1.Location = New System.Drawing.Point(16, 40)
Me.lblSlot1.Name = "lblSlot1"
Me.lblSlot1.Size = New System.Drawing.Size(96, 120)
Me.lblSlot1.TabIndex = 0
'
'lblSlot2
'
Me.lblSlot2.Font = New System.Drawing.Font("Microsoft Sans Serif", 36.0!)
Me.lblSlot2.Location = New System.Drawing.Point(136, 40)
Me.lblSlot2.Name = "lblSlot2"
Me.lblSlot2.Size = New System.Drawing.Size(96, 120)
Me.lblSlot2.TabIndex = 1
'
'lblSlot3
'
Me.lblSlot3.Font = New System.Drawing.Font("Microsoft Sans Serif", 36.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblSlot3.Location = New System.Drawing.Point(256, 40)
Me.lblSlot3.Name = "lblSlot3"
Me.lblSlot3.Size = New System.Drawing.Size(96, 120)
Me.lblSlot3.TabIndex = 2
'
'lblTokens
'
Me.lblTokens.Location = New System.Drawing.Point(112, 184)
Me.lblTokens.Name = "lblTokens"
Me.lblTokens.Size = New System.Drawing.Size(128, 16)
Me.lblTokens.TabIndex = 3
Me.lblTokens.Text = "Tokens you have: 100"
'
'btnPull
'
Me.btnPull.Location = New System.Drawing.Point(128, 224)
Me.btnPull.Name = "btnPull"
Me.btnPull.Size = New System.Drawing.Size(104, 24)
Me.btnPull.TabIndex = 4
Me.btnPull.Text = "Pull"
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(360, 262)
Me.Controls.Add(Me.btnPull)
Me.Controls.Add(Me.lblTokens)
Me.Controls.Add(Me.lblSlot3)
Me.Controls.Add(Me.lblSlot2)
Me.Controls.Add(Me.lblSlot1)
Me.Name = "Form1"
Me.Text = "Slot Machine Game"
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub btnPull_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPull.Click
Dim intSlot1 As Integer = (Rnd() * 10)
Dim intSlot2 As Integer = (Rnd() * 10)
Dim intSlot3 As Integer = (Rnd() * 10)
Static intCounter As Integer = 100
Me.lblSlot1.Text = intSlot1
Me.lblSlot2.Text = intSlot2
Me.lblSlot3.Text = intSlot3
If intSlot1 = intSlot2 And intSlot1 = intSlot3 And intSlot1 = 1 Then
intCounter = intCounter + 4
MessageBox.Show("You get " & intCounter - 100 & " token(s)")
ElseIf intSlot1 = intSlot2 And intSlot1 = intSlot3 And intSlot1 = 2 Then
intCounter = intCounter + 8
MessageBox.Show("You get " & intCounter - 100 & " token(s)")
ElseIf intSlot1 = intSlot2 And intSlot1 = intSlot3 And intSlot1 = 3 Then
intCounter = intCounter + 12
MessageBox.Show("You get " & intCounter - 100 & " token(s)")
ElseIf intSlot1 = intSlot2 And intSlot1 = intSlot3 And intSlot1 = 4 Then
intCounter = intCounter + 16
MessageBox.Show("You get " & intCounter - 100 & " token(s)")
ElseIf intSlot1 = intSlot2 And intSlot1 = intSlot3 And intSlot1 = 5 Then
intCounter = intCounter + 20
MessageBox.Show("You get " & intCounter - 100 & " token(s)")
ElseIf intSlot1 = intSlot2 And intSlot1 = intSlot3 And intSlot1 = 6 Then
intCounter = intCounter + 24
MessageBox.Show("You get " & intCounter - 100 & " token(s)")
ElseIf intSlot1 = intSlot2 And intSlot1 = intSlot3 And intSlot1 = 7 Then
intCounter = intCounter + 28
MessageBox.Show("You get " & intCounter - 100 & " token(s)")
ElseIf intSlot1 = intSlot2 And intSlot1 = intSlot3 And intSlot1 = 8 Then
intCounter = intCounter + 32
MessageBox.Show("You get " & intCounter - 100 & " token(s)")
ElseIf intSlot1 = intSlot2 And intSlot1 = intSlot3 And intSlot1 = 9 Then
intCounter = intCounter + 36
MessageBox.Show("You get " & intCounter - 100 & " token(s)")
ElseIf intSlot1 = intSlot2 And intSlot1 = intSlot3 And intSlot1 = 10 Then
intCounter = intCounter + 40
MessageBox.Show("You get " & intCounter - 100 & " token(s)")
Else
intCounter = intCounter - 1
End If
Me.lblTokens.Text = "Tokens you have: " & intCounter
If intCounter = 0 Then
MessageBox.Show("You lose!", "Fail @ Life")
Me.Close()
End If
End Sub
End Class