| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 426 人关注过本帖
标题:[求助]如何实现这个程序
只看楼主 加入收藏
失魂鱼
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2007-4-26
收藏
 问题点数:0 回复次数:6 
[求助]如何实现这个程序
高手们帮我一下,最近想编这个程序(猜拳游戏),可是做到统计输赢那里就做不了了!请各位帮帮忙!完成后一定会感激大家的!谢谢!
2007-05-20 09:46
失魂鱼
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2007-4-26
收藏
得分:0 
yvJOSp1f.rar (9.33 KB) [求助]如何实现这个程序


就是这个!
2007-05-20 09:48
lll930720
Rank: 1
等 级:新手上路
帖 子:41
专家分:0
注 册:2006-11-14
收藏
得分:0 

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

2007-05-20 10:14
失魂鱼
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2007-4-26
收藏
得分:0 

先谢了楼上的朋友!
现在多了1个问题,就是怎样实现3盘2胜呢?既是玩家最多能点击3次!在这3次中,玩家能点每个按钮!点击3次后,若玩家点击第4次,则用消息框输出"你已经玩完3盘2胜了,若想再玩多1次,请按重玩按钮!"
高手们帮下我吧~谢谢!

2007-05-20 12:05
心中有剑
Rank: 2
等 级:新手上路
威 望:5
帖 子:611
专家分:0
注 册:2007-5-18
收藏
得分:0 

哈哈!加个全局变量了!在text里给这个变量赋值


2007-05-20 12:46
失魂鱼
Rank: 1
等 级:新手上路
帖 子:13
专家分:0
注 册:2007-4-26
收藏
得分:0 
不明白!能具体一下吗?
2007-05-20 13:05
心中有剑
Rank: 2
等 级:新手上路
威 望:5
帖 子:611
专家分:0
注 册:2007-5-18
收藏
得分:0 
设置个变量 为3 ,每次点按钮一次就 减1 啊!依次 如果变量为0 就提示消息筐!

2007-05-20 16:29
快速回复:[求助]如何实现这个程序
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015293 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved