| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 664 人关注过本帖
标题:上课用的,哪位大侠愿意帮忙,求教备注下汉语意思啊
取消只看楼主 加入收藏
Wimong
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2013-5-17
结帖率:0
收藏
已结贴  问题点数:10 回复次数:4 
上课用的,哪位大侠愿意帮忙,求教备注下汉语意思啊
打字母游戏中的代码(忘了哪里下载的了)

开始:Command2    暂停:Command1   重玩:Command3
lable是字母

Private Sub Command2_Click()
Timer1.Enabled = True
End Sub

Private Sub Command3_Click()   
Picture1.Item(0).Top = -1000
Picture1.Item(2).Top = -800
Picture1.Item(3).Top = -700
Picture1.Item(4).Top = -800
Picture1.Item(1).Top = -600
Timer1.Enabled = False
Dim a(5) As Integer
Randomize
a(1) = Int(65 + 25 * Rnd)
Label1.Item(0).Caption = Chr(a(1))
k = 1
Do While k < 5
m = Int(Rnd * 25 + 65)
f = 0
For j = 1 To k
   If m = a(j) Then
   f = 1
   Exit For
   End If
Next j
If f = 0 Then
   k = k + 1
   a(k) = m
   Label1.Item(k - 1).Caption = Chr(m)
   End If
   Loop
   p = 0
End Sub
搜索更多相关主题的帖子: 字母 游戏 汉语意思 
2015-10-10 22:09
Wimong
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2013-5-17
收藏
得分:0 
Private Sub Form_Load()
sum = 100
num = 10
Dim a(5) As Integer
Randomize
a(1) = Int(65 + 25 * Rnd)
Label1.Item(0).Caption = Chr(a(1))
k = 1
Do While k < 5
m = Int(Rnd * 25 + 65)
f = 0
For j = 1 To k
   If m = a(j) Then
   f = 1
   Exit For
   End If
Next j
If f = 0 Then
   k = k + 1
   a(k) = m
   Label1.Item(k - 1).Caption = Chr(m)
   End If
   Loop
End Sub
2015-10-10 22:13
Wimong
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2013-5-17
收藏
得分:0 
谢谢啊
2015-10-11 23:13
Wimong
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2013-5-17
收藏
得分:0 
谢谢
2015-10-11 23:18
Wimong
Rank: 1
等 级:新手上路
帖 子:17
专家分:0
注 册:2013-5-17
收藏
得分:0 
哪位大侠把红色部分帮助注释一下啊。
Public h As Integer
Public s As Integer
Public p As Integer
Public sum As Integer, num As Integer
Private Sub Command1_Click()
Timer1.Enabled = False

End Sub

Private Sub Command2_Click()
Timer1.Enabled = True
End Sub
----------------------以下键盘输入
Private Sub Form_KeyPress(KeyAscii As Integer)
For i = 0 To 4                                  ‘当i从0到4依次取值
If Label1.Item(i).Caption = Chr(KeyAscii - 32) Then  '如果输入字母与标签中字母相同
s = s + 1                                              ‘?
If s = sum Then Form3.Show: Form3.Label1.Caption = "恭喜你顺利过关!再接再厉吧!": Timer1.Enabled = False

Label1.Item(i).Caption = letter(i)                  ’?
Picture1.Item(i).Top = -600                        '字母消失?
    k = 1
Do While k <> 0
     k = 0
    n = Chr(Int(25 * Rnd + 65))
For j = 0 To 4
   If n = Label1.Item(j).Caption Then k = k + 1
   Next j
   If k = 0 Then Label1.Item(i).Caption = n
    Loop

   End If
Next i
End Sub

-------------------以下是游戏开始
Private Sub Form_Load()
sum = 100
num = 10
Dim a(5) As Integer      定义5个数组
Randomize
a(1) = Int(65 + 25 * Rnd)   ‘随机取字母
Label1.Item(0).Caption = Chr(a(1))  '?
k = 1                                  '?
Do While k < 5
m = Int(Rnd * 25 + 65)
f = 0
For j = 1 To k
   If m = a(j) Then
   f = 1
   Exit For
   End If
Next j
If f = 0 Then
   k = k + 1
   a(k) = m
   Label1.Item(k - 1).Caption = Chr(m)
   End If
   Loop
End Sub
2015-10-11 23:25
快速回复:上课用的,哪位大侠愿意帮忙,求教备注下汉语意思啊
数据加载中...
 
   



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

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