这是一个和电脑玩剪刀,石头,布的游戏
总觉得没有错,也可以运行,可是效果有点怪,有谁能帮偶纠正一下,感激不尽......
怪处就是当偶连续两次出同一样东西的时候,电脑也有可能出一样的,可是数字不会变
或者,连续两次出同一样时,电脑好象没有反映,
偶是初学,想来想去都想不出为什么?
Private Sub Command1_Click()
Image1.Visible = True
Image2.Visible = False
Image3.Visible = False
If Label3(Int(3 * Rnd)).Caption = "剪刀" Then
Image4.Visible = True
Image6.Visible = False
Image7.Visible = False
Label4.Caption = "平手不算!再来啊!"
Label1.Caption = Val(Label1.Caption)
Label2.Caption = Val(Label2.Caption)
End If
If Label3(Int(3 * Rnd)).Caption = "石头" Then
Image4.Visible = False
Image6.Visible = True
Image7.Visible = False
Label4.Caption = "哈哈,给点颜色你瞧瞧!"
Label1.Caption = Val(Label1.Caption) + 0
Label2.Caption = Val(Label2.Caption) + 1
End If
If Label3(Int(3 * Rnd)).Caption = "布" Then
Image4.Visible = False
Image6.Visible = False
Image7.Visible = True
Label4.Caption = "别得意,下次俺一定赢!"
Label1.Caption = Val(Label1.Caption) + 1
Label2.Caption = Val(Label2.Caption) + 0
End If
End Sub
Private Sub Command2_Click()
Image1.Visible = False
Image2.Visible = True
Image3.Visible = False
If Label3(Int(3 * Rnd)).Caption = "剪刀" Then
Image4.Visible = True
Image6.Visible = False
Image7.Visible = False
Label4.Caption = "别得意,下次俺一定赢!"
Label1.Caption = Val(Label1.Caption) + 1
Label2.Caption = Val(Label2.Caption) + 0
End If
If Label3(Int(3 * Rnd)).Caption = "石头" Then
Image4.Visible = False
Image6.Visible = True
Image7.Visible = False
Label4.Caption = "平手不算!再来啊!"
Label1.Caption = Val(Label1.Caption)
Label2.Caption = Val(Label2.Caption)
End If
If Label3(Int(3 * Rnd)).Caption = "布" Then
Image4.Visible = False
Image6.Visible = False
Image7.Visible = True
Label4.Caption = "哈哈,给点颜色你瞧瞧!"
Label1.Caption = Val(Label1.Caption) + 0
Label2.Caption = Val(Label2.Caption) + 1
End If
End Sub
Private Sub Command3_Click()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = True
If Label3(Int(3 * Rnd)).Caption = "剪刀" Then
Image4.Visible = True
Image6.Visible = False
Image7.Visible = False
Label4.Caption = "哈哈,给点颜色你瞧瞧!"
Label1.Caption = Val(Label1.Caption) + 0
Label2.Caption = Val(Label2.Caption) + 1
End If
If Label3(Int(3 * Rnd)).Caption = "石头" Then
Image4.Visible = False
Image6.Visible = True
Image7.Visible = False
Label4.Caption = "别得意,下次俺一定赢!"
Label1.Caption = Val(Label1.Caption) + 1
Label2.Caption = Val(Label2.Caption) + 0
End If
If Label3(Int(3 * Rnd)).Caption = "布" Then
Image4.Visible = False
Image6.Visible = False
Image7.Visible = True
Label4.Caption = "平手不算!再来啊!"
Label1.Caption = Val(Label1.Caption)
Label2.Caption = Val(Label2.Caption)
End If
End Sub
Private Sub Command4_Click()
Label1.Caption = "0"
Label2.Caption = "0"
Label4.Caption = ""
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image6.Visible = False
Image7.Visible = False
End Sub