第2个回答 2007-06-27
本程序模拟北京奥运会倒计时,
根据你设定的北京奥运会开幕时间,
与当前的时间进行计算,计算出剩余
的天数,小时数,分钟数与秒数,并显
示在窗口上.
邮件已经发到你的邮箱.
第4个回答 2007-06-30
选我的!!!!!!!!!!!!!!!!!!推箱子
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
ox = nx: oy = ny
Select Case KeyCode
Case vbKeyRight
r = 1
Case vbKeyLeft
r = 3
Case vbKeyUp
r = 2
Case vbKeyDown
r = 4
Case Else
Exit Sub
End Select
nx = ox + mx(r): ny = oy + my(r)
If ps(nx, ny) = 1 Then nx = ox: ny = oy
a = ox + (oy - 1) * 8: b = nx + (ny - 1) * 8
If ps(nx, ny) = 0 Or ps(nx, ny) = 2 Then
Image10(a).Picture = Image4.Picture
If ps(nx, ny) = 2 Then
Image10(b).Picture = Image6(r).Picture
Else: Image10(b).Picture = Image5(r).Picture
End If
ps(ox, oy) = 0: ps(nx, ny) = 5
End If
If ps(nx, ny) = 3 Then
bx = nx + mx(r): By = ny + my(r)
If ps(bx, By) = 1 Or ps(bx, By) = 3 Then
nx = ox: ny = oy
Else
If (ps(bx, By) = 0 Or ps(bx, By) = 2) Then
c = bx + (By - 1) * 8
Image10(a).Picture = Image4.Picture
Image10(b).Picture = Image5(r).Picture
If ps(bx, By) = 0 Then
Image10(c).Picture = Image3.Picture
ps(ox, oy) = 0: ps(nx, ny) = 5: ps(bx, By) = 3
End If
If ps(bx, By) = 2 Then
Image10(c).Picture = Image9.Picture
ps(ox, oy) = 0: ps(nx, ny) = 5: ps(bx, By) = 3
End If
End If
End If
End If
flag = 0
For w = 1 To obn
If ps(obx(w), oby(w)) = 3 Then flag = flag + 1
If flag = obn Then
MsgBox "胜利!完成任务!!", vbOKOnly + vbApplicationModale, "胜利!!"
msg = vbCancel
z = z + 1
If z = 5 Then End
init
End If
If ps(ox, oy) = 0 And (ox = obx(w) And oy = oby(w)) Then
Image10(ox + (oy - 1) * 8).Picture = Image2.Picture
ps(ox, oy) = 2
End If
Next w
If msg = vbCancel Then Exit Sub
End Sub
Private Sub Form_Load()
Open "f:\vbp\DATA1.txt" For Input As #1
For z = 1 To 5
For y = 1 To 8
Line Input #1, da
For x = 1 To 8
db(z, x, y) = Val(Mid(da, x, 1))
Next x
Next y
Next z
z = 1
init
For y = 1 To 8
For x = 1 To 8
ps(x, y) = db(z, x, y)
Next x
Next y
For x = 1 To 8
For y = 1 To 8
a = x + (y - 1) * 8
If ps(x, y) = 1 Then Image10(a).Picture = Image1.Picture
If ps(x, y) = 2 Then Image10(a).Picture = Image2.Picture
If ps(x, y) = 3 Then Image10(a).Picture = Image3.Picture
If ps(x, y) = 0 Then Image10(a).Picture = Image4.Picture
If ps(x, y) = 5 Then
Image10(a).Picture = Image5(r).Picture
nx = x: ny = y
End If
Next y
Next x
mx(1) = 1: mx(3) = -1: my(2) = -1: my(4) = 1
End Sub
Private Sub init()
obn = 0
For x = 1 To 8
For y = 1 To 8
ps(x, y) = db(z, x, y)
a = x + (y - 1) * 8
If ps(x, y) = 1 Then Image10(a).Picture = Image1.Picture
If ps(x, y) = 2 Then
Image10(a).Picture = Image2.Picture
obn = obn + 1
obx(obn) = x: oby(obn) = y
End If
If ps(x, y) = 3 Then Image10(a).Picture = Image3.Picture
If ps(x, y) = 0 Then Image10(a).Picture = Image4.Picture
If ps(x, y) = 5 Then
Image10(a).Picture = Image5(r).Picture
nx = x: ny = y
End If
Next y
Next x
End Sub
Private Sub jsyx_Click()
End
End Sub
Private Sub n_Click()
z = 1
init
End Sub
Private Sub writer_Click()
MsgBox "程序制作:XXX E-mail:_________@yahoo.com.cn", vbOKOnly + vbApplicationModale, "作者版权"
msg = vbCancel
End Sub