Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Private Sub btn_play_Click(sender As Object, e As EventArgs) Handles btn_play.Click
- Dim computer As Integer
- Dim user As Integer
- txt_winner.Clear()
- Randomize()
- computer = CInt(Int((3 * Rnd()) + 1))
- If computer = 1 Then
- txt_computer.Text = "Rock"
- End If
- If computer = 2 Then
- txt_computer.Text = "Paper"
- End If
- If computer = 3 Then
- txt_computer.Text = "Scissors"
- End If
- If RadioButton1.Checked = True Then
- user = 1
- End If
- If RadioButton2.Checked = True Then
- user = 2
- End If
- If RadioButton3.Checked = True Then
- user = 3
- End If
- 'who wins
- 'Draw
- If user = computer Then
- txt_winner.Text = "Draw Game"
- End If
- 'User win combinations ..............
- If (user = 1) And (computer = 3) Then
- txt_winner.Text = "User Wins... Rock beats Scissors"
- End If
- If (user = 3) And (computer = 2) Then
- txt_winner.Text = "User Wins... Scissors beats Paper"
- End If
- If (user = 2) And (computer = 1) Then
- txt_winner.Text = "User Wins... Paper beats Rock"
- End If
- 'Computer win combinations ..............
- If (user = 3) And (computer = 1) Then
- txt_winner.Text = "Computer Wins... Rock beats Scissors"
- End If
- If (user = 2) And (computer = 3) Then
- txt_winner.Text = "Computer Wins... Scissors beats Paper"
- End If
- If (user = 1) And (computer = 2) Then
- txt_winner.Text = "Computer Wins... Paper beats Rock"
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement