

Private Sub Command1_Click()
Dim a As Integer
Randomize
a = Int(Rnd * 3) + 1
If a = 1 Then
Image1.Picture = LoadPicture(App.Path & "\bao.jpg")
Label1.Caption = "包"
Label2.Caption = "包"
Image2.Picture = LoadPicture(App.Path & "\bao.jpg")
Label10.Caption = Label10.Caption + 1
MsgBox "看来我们的实力相当", vbInformation, "猜拳游戏"
Else
If a = 2 Then
Image1.Picture = LoadPicture(App.Path & "\jian.jpg")
Label1.Caption = "剪"
Label2.Caption = "包"
Image2.Picture = LoadPicture(App.Path & "\bao.jpg")
Label8.Caption = Label8.Caption + 1
MsgBox "你实在太垃圾了!哈哈~`", vbInformation, "猜拳游戏"
Else
Image1.Picture = LoadPicture(App.Path & "\chui.jpg")
Label1.Caption = "锤"
Label2.Caption = "包"
Image2.Picture = LoadPicture(App.Path & "\bao.jpg")
Label6.Caption = Label6.Caption + 1
MsgBox "这是我让你的!", vbInformation, "猜拳游戏"
End If
End If
End Sub
Private Sub Command2_Click()
Dim a As Integer
Randomize
a = Int(Rnd * 3) + 1
If a = 1 Then
Image1.Picture = LoadPicture(App.Path & "\bao.jpg")
Label1.Caption = "包"
Label2.Caption = "剪"
Image2.Picture = LoadPicture(App.Path & "\jian.jpg")
Label6.Caption = Label6.Caption + 1
MsgBox "这是我让你的!", vbInformation, "猜拳游戏"
Else
If a = 2 Then
Image1.Picture = LoadPicture(App.Path & "\jian.jpg")
Label1.Caption = "剪"
Label2.Caption = "剪"
Image2.Picture = LoadPicture(App.Path & "\jian.jpg")
Label10.Caption = Label10.Caption + 1
MsgBox "看来我们的实力相当", vbInformation, "猜拳游戏"
Else
Image1.Picture = LoadPicture(App.Path & "\chui.jpg")
Label1.Caption = "锤"
Label2.Caption = "剪"
Image2.Picture = LoadPicture(App.Path & "\jian.jpg")
Label8.Caption = Label8.Caption + 1
MsgBox "你实在太垃圾了!哈哈~`", vbInformation, "猜拳游戏"
End If
End If
End Sub
Private Sub Command3_Click()
Dim a As Integer
Randomize
a = Int(Rnd * 3) + 1
If a = 1 Then
Image1.Picture = LoadPicture(App.Path & "\bao.jpg")
Label1.Caption = "包"
Label2.Caption = "锤"
Image2.Picture = LoadPicture(App.Path & "\chui.jpg")
Label8.Caption = Label8.Caption + 1
MsgBox "你实在太垃圾了!哈哈~`", vbInformation, "猜拳游戏"
Else
If a = 2 Then
Image1.Picture = LoadPicture(App.Path & "\jian.jpg")
Label1.Caption = "剪"
Label2.Caption = "锤"
Image2.Picture = LoadPicture(App.Path & "\chui.jpg")
Label6.Caption = Label6.Caption + 1
MsgBox "这是我让你的!", vbInformation, "猜拳游戏"
Else
Image1.Picture = LoadPicture(App.Path & "\chui.jpg")
Label1.Caption = "锤"
Label2.Caption = "锤"
Image2.Picture = LoadPicture(App.Path & "\chui.jpg")
Label10.Caption = Label10.Caption + 1
MsgBox "看来我们的实力相当", vbInformation, "猜拳游戏"
End If
End If
End Sub
Private Sub Form_Load()
Label6.Caption = 0
Label6.ForeColor = vbGreen
Label8.Caption = 0
Label8.ForeColor = vbRed
Label10.Caption = 0
Label10.ForeColor = vbBlue
End Sub
先谢了楼上的朋友!
现在多了1个问题,就是怎样实现3盘2胜呢?既是玩家最多能点击3次!在这3次中,玩家能点每个按钮!点击3次后,若玩家点击第4次,则用消息框输出"你已经玩完3盘2胜了,若想再玩多1次,请按重玩按钮!"
高手们帮下我吧~谢谢!