内容很简单,自己多改一下!
--------------------------------
Option Explicit
Dim x As Integer
Private Sub Command1_Click()
Randomize
x = Fix(3 * Rnd)
If x = 1 Then MsgBox "你是石头我是布,我赢了"
If x = 2 Then MsgBox "我们都是石头,打平了"
If x = 3 Then MsgBox "你是石头我是剪刀,你赢了"
End Sub
Private Sub Command2_Click()
Randomize
x = Fix(3 * Rnd)
If x = 1 Then MsgBox "你是剪刀我是布,你赢了"
If x = 2 Then MsgBox "你是剪刀我是石头,我赢了"
If x = 3 Then MsgBox "我们都是剪刀,打平了"
End Sub
Private Sub Command3_Click()
Randomize
x = Fix(3 * Rnd)
If x = 1 Then MsgBox "我们都是布,打平了"
If x = 2 Then MsgBox "你是石头我是布,我赢了"
If x = 3 Then MsgBox "你是布我是石头,你赢了"
End Sub
Private Sub Form_Load()
Command1.Caption = "石头"
Command2.Caption = "剪刀"
Command3.Caption = "布"
End Sub