Private Sub Command1_Click()
Randomize
Dim i As Integer
i = Int(3 * Rnd + 1)
If i = 1 Then
MsgBox ("电脑出的是布,你输了")
Else
If i = 2 Then
MsgBox ("电脑出的是石头,平手")
Else
MsgBox ("电脑出的是剪刀,你赢了")
End If
End If
End Sub
Private Sub Command2_Click()
Randomize
Dim i As Integer
i = Int(3 * Rnd + 1)
If i = 1 Then
MsgBox ("电脑出的是布,你赢了")
Else
If i = 2 Then
MsgBox ("电脑出的是石头,你输了")
Else
MsgBox ("电脑出的是剪刀,平手")
End If
End If
End Sub
Private Sub Command3_Click()
Randomize
Dim i As Integer
i = Int(3 * Rnd + 1)
If i = 1 Then
MsgBox ("电脑出的是布,平手")
Else
If i = 2 Then
MsgBox ("电脑出的是石头,你赢了")
Else
MsgBox ("电脑出的是剪刀,你输了")
End If
End If
End Sub
Randomize
Dim i As Integer
i = Int(3 * Rnd + 1)
If i = 1 Then
MsgBox ("电脑出的是布,你输了")
Else
If i = 2 Then
MsgBox ("电脑出的是石头,平手")
Else
MsgBox ("电脑出的是剪刀,你赢了")
End If
End If
End Sub
Private Sub Command2_Click()
Randomize
Dim i As Integer
i = Int(3 * Rnd + 1)
If i = 1 Then
MsgBox ("电脑出的是布,你赢了")
Else
If i = 2 Then
MsgBox ("电脑出的是石头,你输了")
Else
MsgBox ("电脑出的是剪刀,平手")
End If
End If
End Sub
Private Sub Command3_Click()
Randomize
Dim i As Integer
i = Int(3 * Rnd + 1)
If i = 1 Then
MsgBox ("电脑出的是布,平手")
Else
If i = 2 Then
MsgBox ("电脑出的是石头,你赢了")
Else
MsgBox ("电脑出的是剪刀,你输了")
End If
End If
End Sub