求高手注释,实在看不太懂!!
Dim s, sj, cs, fs, sp, fw As IntegerDim zm As String
Dim dz(100) As Integer
Private Sub Form_KeyPress(Kb As Integer)
zm = Chr$(Kb)
End Sub
Private Sub Form_Load()
s = 20
sj = 50
Randomize
For n = 0 To s - 1
a(n).Top = 0
Next n
For n = 0 To s - 1
B(m).Top = Form1.ScaleHeight
B(m).Visible = False
Next n
fs = 0
sp = 100
a(0).Top = 1
a(0).Visible = True
x = Int(Rnd * 25) + 65
a(0).Caption = Chr$(x)
fw = Form1.ScaleWidth - 10
y = Int(Rnd * fw) + 5
a(0).Left = y
End Sub
Private Sub t1_Timer()
If fs > 0 And fs Mod 200 = 0 Then
sj = 50 - fs / 200
If sj <= 0 Then sj = 1
End If
cs = cs + 1
If cs >= sj Then
For n = 0 To s - 1
If a(n).Top = 0 Then
a(n).Top = 1
a(n).Visible = True
x = Int(Rnd * 25) + 65
a(n).Caption = Chr$(x)
y = Int(Rnd * fw) + 5
a(n).Left = y
cs = 0
Exit For
End If
Next n
End If
k = -1
tp = -1
For n = 0 To s - 1
If a(n).Top >= 0 And a(n).Caption = zm And a(n).Top > tp Then
k = n
tp = a(n).Top
End If
Next n
If k >= 0 Then
For n = 0 To s - 1
If Not B(n).Visible Then
B(n).Top = Form1.ScaleHeight - 50
B(n).Visible = True
B(n).Left = a(k).Left
B(n).Caption = a(k).Caption
dz(n) = k
zm = ""
Exit For
End If
Next n
End If
For n = 0 To s - 1
If a(n).Top > 0 Then
a(n).Top = a(n).Top + sp
If a(n).Top + a(n).Height >= Form1.ScaleHeight Then
fs = fs - 10
a(n).Top = 0
a(n).Visible = False
End If
End If
Next n
For n = 0 To s - 1
If B(n).Visible Then
B(n).Top = B(n).Top - 5 * sp
If B(n).Top <= a(dz(n)).Top + a(dz(n)).Height Then
fs = fs + 10
a(dz(n)).Top = 0
a(dz(n)).Visible = False
B(n).Top = Form1.ScaleHeight
B(n).Visible = False
End If
End If
Next n
Label1.Caption = Str$(fs)
End Sub
--------------------编程问答-------------------- Dim s, sj, cs, fs, sp, fw As Integer
光看这一句就没兴趣再往下了. 楼主还是另找代码吧, 这代码不咋的 --------------------编程问答-------------------- Dim s, sj, cs, fs, sp, fw As Integer
=>
Dim s As Integer, sj As Integer, cs As Integer, fs As Integer, sp As Integer, fw As Integer
这才是正确的写法。
--------------------编程问答-------------------- 拜托各位帮帮忙啊,我也是从别的地方找的,要不各位提供一些好的源代码
补充:VB , 网络编程