VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Rock, Paper Scissors, like another version I saw on vbcode.com but better cause its completed

by MMARTENS (1 Submission)
Category: Games
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 14th December 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

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



'''''''''''''''''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


Download this snippet    Add to My Saved Code

Rock, Paper Scissors, like another version I saw on vbcode.com but better cause its completed Comments

No comments have been posted about Rock, Paper Scissors, like another version I saw on vbcode.com but better cause its completed. Why not be the first to post a comment about Rock, Paper Scissors, like another version I saw on vbcode.com but better cause its completed.

Post your comment

Subject:
Message:
0/1000 characters