Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class frmStart
- Dim intcard1, intcard2, intScore As Integer
- Private Sub BtnLow_Click(sender As Object, e As EventArgs) Handles btnLow.Click
- intcard2 = getRandom()
- Select Case intcard2
- Case 1
- PicCard2.Image = My.Resources.C2
- Case 2
- PicCard2.Image = My.Resources.C3
- Case 3
- PicCard2.Image = My.Resources.C4
- Case 4
- PicCard2.Image = My.Resources.C5
- Case 5
- PicCard2.Image = My.Resources.C6
- Case 6
- PicCard2.Image = My.Resources.C7
- Case 7
- PicCard2.Image = My.Resources.C8
- Case 8
- PicCard2.Image = My.Resources.C9
- Case 9
- PicCard2.Image = My.Resources.C10
- Case 10
- PicCard2.Image = My.Resources.CA
- Case 11
- PicCard2.Image = My.Resources.CJ
- Case 12
- PicCard2.Image = My.Resources.CQ
- Case 13
- PicCard2.Image = My.Resources.CK
- End Select
- If intcard1 < intcard2 Then
- lblMessageBox.Text = "Good Job"
- intScore += 1
- lblScore.Text = intScore.ToString
- intcard1 = intcard2
- PicCard1.Image = PicCard2.Image
- PicCard2.Image = Nothing
- ElseIf intcard2 = intcard1 Then
- lblMessageBox.Text = "You have Drew, Press Start to play again"
- intcard1 = intcard2
- PicCard1.Image = PicCard2.Image
- PicCard2.Image = Nothing
- Else
- PicCard2.Show()
- lblMessageBox.Text = "Maybe you'll get it next time, Press Start to play again"
- intScore = 0
- End If
- End Sub
- Private Sub BtnHigh_Click(sender As Object, e As EventArgs) Handles btnHigh.Click
- intcard2 = getRandom()
- Select Case intcard2
- Case 1
- PicCard2.Image = My.Resources.C2
- Case 2
- PicCard2.Image = My.Resources.C3
- Case 3
- PicCard2.Image = My.Resources.C4
- Case 4
- PicCard2.Image = My.Resources.C5
- Case 5
- PicCard2.Image = My.Resources.C6
- Case 6
- PicCard2.Image = My.Resources.C7
- Case 7
- PicCard2.Image = My.Resources.C8
- Case 8
- PicCard2.Image = My.Resources.C9
- Case 9
- PicCard2.Image = My.Resources.C10
- Case 10
- PicCard2.Image = My.Resources.CA
- Case 11
- PicCard2.Image = My.Resources.CJ
- Case 12
- PicCard2.Image = My.Resources.CQ
- Case 13
- PicCard2.Image = My.Resources.CK
- End Select
- If intcard2 > intcard1 Then
- lblMessageBox.Text = "Good Job"
- intScore += 1
- lblScore.Text = intScore.ToString
- intcard2 = intcard1
- PicCard1.Image = PicCard2.Image
- PicCard2.Image = Nothing
- ElseIf intcard2 = intcard1 Then
- lblMessageBox.Text = "You have Drew, Press Start to play again"
- intcard2 = intcard1
- PicCard1.Image = PicCard2.Image
- PicCard2.Image = Nothing
- Else
- PicCard2.Show()
- lblMessageBox.Text = "Maybe you'll get it next time, Press Start to play again"
- intScore = 0
- End If
- End Sub
- Private Sub btnReturn_Click(sender As Object, e As EventArgs) Handles btnReturn.Click
- frmabout.Show()
- Me.Hide()
- End Sub
- Private Sub btnStart_Click(sender As Object, e As EventArgs) Handles btnStart.Click
- PicCard2.Hide()
- intcard1 = getRandom()
- Select Case intcard1
- Case 1
- PicCard1.Image = My.Resources.C2
- Case 2
- PicCard1.Image = My.Resources.C3
- Case 3
- PicCard1.Image = My.Resources.C4
- Case 4
- PicCard1.Image = My.Resources.C5
- Case 5
- PicCard1.Image = My.Resources.C6
- Case 6
- PicCard1.Image = My.Resources.C7
- Case 7
- PicCard1.Image = My.Resources.C8
- Case 8
- PicCard1.Image = My.Resources.C9
- Case 9
- PicCard1.Image = My.Resources.C10
- Case 10
- PicCard1.Image = My.Resources.CA
- Case 11
- PicCard1.Image = My.Resources.CJ
- Case 12
- PicCard1.Image = My.Resources.CQ
- Case 13
- PicCard1.Image = My.Resources.CK
- End Select
- End Sub
- Public Function getRandom() As Integer
- Randomize()
- Dim randomNum = CInt(Int(13 - 1 + 1) * Rnd() + 1)
- Return randomNum
- End Function
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement