by Celia (1 Submission)
Category: Games
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Tue 9th May 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Code for the OLD Paper, Rock, Scissors Game
API Declarations
'the randomizer for the computer's turn to choose
'WTL is for the select case structure to keep up with the total number of wins, ties and losses
Randomize
Dim cChoice As Integer
cChoice = Int((3 * Rnd) + 1)
If cChoice = 1 Then
txtCompChoice.Text = "Paper"
End If
If cChoice = 2 Then
txtCompChoice.Text = "Rock"
End If
If cChoice = 3 Then
txtCompChoice.Text = "Scissors"
End If
uChoice = 3
txtUserChoice.Text = "Scissors"
If uChoice = cChoice Then
txtStatus.Text = "Tie!"
WTL = 1
ElseIf uChoice = 3 And cChoice = 2 Then
txtStatus.Text = "You Lose, Rock Smashes Scissors!"
WTL = 3
ElseIf uChoice = 3 And cChoice = 1 Then
txtStatus.Text = "You Win, Chop, Chop!"
WTL = 2
End If
Select Case WTL
Case 1
Ties = Ties + 1
lblTies.Caption = "Ties: " & Ties
Case 2
Wins = Wins + 1
lblWins.Caption = "Wins: " & Wins
Case 3
Losses = Losses + 1
lblLosses.Caption = "Losses: " & Losses
End Select
End Sub