VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Its a Rock Paper Scissors game

by Clay Spencer (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 15th April 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Its a Rock Paper Scissors game

API Declarations


Dim paper As Integer
Dim scissors As Integer
Dim a As Integer
Dim b As Integer
Dim c As Integer

Rate Its a Rock Paper Scissors game



a = (Rnd * 3) + 1
If a = 1 Then
MsgBox ("Paper!")
MsgBox ("You have been defeated!")
b = b + 1
End If
If a = 2 Then
MsgBox ("Scissors!")
MsgBox ("You Win!")
c = c + 1
End If
If a = 3 Then
MsgBox ("Rock!")
MsgBox ("Tie!")
End If
Txt2 = b
Txt1 = c
If b = 5 Then
MsgBox "You have lost too many times, but there is always another day!"
Txt1 = 0
Txt2 = 0
b = 0
c = 0
End If
If c = 5 Then
MsgBox "You are a very good guesser, you have won!"
Txt1 = 0
Txt2 = 0
b = 0
c = 0
End If


End Sub

Private Sub Cmd2_Click()
a = (Rnd * 3) + 1
If a = 1 Then
MsgBox ("Paper!")
MsgBox ("Tie!")
End If
If a = 2 Then
MsgBox ("Scissors!")
MsgBox ("You have been defeated!")
b = b + 1
End If
If a = 3 Then
MsgBox ("Rock!")
MsgBox ("You Win!")
c = c + 1
End If
Txt2 = b
Txt1 = c
If b = 5 Then

MsgBox "You have lost too many times, but there is always another day!"
Txt1 = 0
Txt2 = 0
b = 0
c = 0
End If

If c = 5 Then
MsgBox "You are a very good guesser, you have won!"
Txt1 = 0
Txt2 = 0
b = 0
c = 0
End If
End Sub

Private Sub cmd3_Click()
a = (Rnd * 3) + 1
If a = 1 Then
MsgBox ("Paper!")
MsgBox ("You Win!")
c = c + 1
End If
If a = 2 Then
MsgBox ("Scissors!")
MsgBox ("Tie!")
End If
If a = 3 Then
MsgBox ("Rock!")
MsgBox ("You have been defeated!")
b = b + 1
End If
Txt2 = b
Txt1 = c
If b = 5 Then

MsgBox "You have lost too many times, but there is always another day!"
Txt1 = 0
Txt2 = 0
b = 0
c = 0
End If
If c = 5 Then
MsgBox "You are a very good guesser, you have won!"
Txt1 = 0
Txt2 = 0
b = 0
c = 0
End If
End Sub

Private Sub Form_Load()
Randomize
Txt1 = 0
Txt2 = 0
If b = 5 Then
End
MsgBox "You have lost too many times, but there is always another day!"
End If
If c = 5 Then
End
MsgBox "You are a very good guesser, you have won!"
End If


End Sub


Download this snippet    Add to My Saved Code

Its a Rock Paper Scissors game Comments

No comments have been posted about Its a Rock Paper Scissors game. Why not be the first to post a comment about Its a Rock Paper Scissors game.

Post your comment

Subject:
Message:
0/1000 characters