- Home
·
- Games
·
- Rock, Paper Scissors, like another version I saw on vbcode.com but better cause its completed
Rock, Paper Scissors, like another version I saw on vbcode.com but better cause its completed
Rock, Paper Scissors, like another version I saw on vbcode.com but better cause its completed
API Declarations
3 Textboxes (txtComp, txtYou, Text3)
3 Command Buttons (cmdRock, cmdPaper, cmdScissors)
Rate Rock, Paper Scissors, like another version I saw on vbcode.com but better cause its completed
(1(1 Vote))
'''''''''''''''''Code by Matt'''''''''''''''''''''''
Private Sub cmdPaper_Click()
Dim CC As Integer
Dim UC As Integer
CC = Int((Rnd * 3) + 1)
If CC = 1 Then
txtComp = "Rock"
ElseIf CC = 2 Then
txtComp = "Paper"
Else
txtComp = "Scisors"
End If
txtYou = "Paper"
UC = 2
If CC = UC Then
Text3 = "Tie, try again."
lblTies = lblTies + 1
ElseIf CC = 3 Then
Text3 = "You lose! Scisors cuts Paper."
lblLosses = lblLosses + 1
ElseIf CC = 1 Then
Text3 = "You Win! Play again!"
lblWins = lblWins + 1
End If
End Sub
Private Sub cmdRock_Click()
Dim CC As Integer
Dim UC As Integer
CC = Int((Rnd * 3) + 1)
If CC = 1 Then
txtComp = "Rock"
ElseIf CC = 2 Then
txtComp = "Paper"
Else
txtComp = "Scisors"
End If
txtYou = "Rock"
UC = 1
If CC = UC Then
Text3 = "Tie, try again."
lblTies = lblTies + 1
ElseIf CC = 2 Then
Text3 = "You lose! Paper covers Rock."
lblLosses = lblLosses + 1
ElseIf CC = 3 Then
Text3 = "You Win! Play again!"
lblWins = lblWins + 1
End If
End Sub
Private Sub cmdScissors_Click()
Dim CC As Integer
Dim UC As Integer
CC = Int((Rnd * 3) + 1)
If CC = 1 Then
txtComp = "Rock"
ElseIf CC = 2 Then
txtComp = "Paper"
Else
txtComp = "Scissors"
End If
txtYou = "Scissors"
UC = 3
If CC = UC Then
Text3 = "Tie, try again."
lblTies = lblTies + 1
ElseIf CC = 1 Then
Text3 = "Crack is Bad!"
lblLosses = lblLosses + 1
ElseIf CC = 2 Then
Text3 = "You Win! Play again!"
lblWins = lblWins + 1
End If
End Sub
Private Sub Form_Load()
Label2 = InputBox("Please Enter your name.")
Randomize
End Sub
Rock, Paper Scissors, like another version I saw on vbcode.com but better cause its completed Comments
No comments yet — be the first to post one!
Post a Comment