10坏小子 10坏小子
石家庄
关注数: 34 粉丝数: 106 发帖数: 3,012 关注贴吧数: 4
大婶们帮忙看看这段代码 Dim a%, b%, c%, z%, i%, n%, y%, k% Public x% Private Sub Command1_Click() Form5.Hide Form1.Show End Sub Private Sub Command2_Click() Form5.Hide form2.Show End Sub Private Sub Command3_Click() Randomize y = y + 1 a = Int(Rnd * 50) + 1 b = Int(Rnd * 50) + 1 c = Int(Rnd * 2) + 1 Select Case c Case 1 Label1.Caption = a Label3.Caption = b Label2.Caption = "+" z = a + b For i = 0 To 3 Option1(i).Caption = Int(Rnd * 100) + 1 Next i Option1(Int(Rnd * 4)).Caption = z Case 2 If a < b Then t = b: b = a: a = t End If Label1.Caption = a Label3.Caption = b Label2.Caption = "-" z = a - b For i = 0 To 3 Option1(i).Caption = Int(Rnd * 100) + 1 Next i Option1(Int(Rnd * 4)).Caption = z End Select If Option1(0).Value = False And Option1(1).Value = False And Option1(2).Value = False And Option1(3).Value = False Then n = MsgBox("你确定要放弃吗") If n = 1 Then a = Int(Rnd * 50) + 1 b = Int(Rnd * 50) + 1 c = Int(Rnd * 2) + 1 Select Case c Case 1 Label1.Caption = a Label3.Caption = b Label2.Caption = "+" z = a + b For i = 0 To 3 Option1(i).Caption = Int(Rnd * 100) + 1 Next i Option1(Int(Rnd * 4)).Caption = z Case 2 If a < b Then t = b: b = a: a = t End If Label1.Caption = a Label3.Caption = b Label2.Caption = "-" z = a - b For i = 0 To 3 Option1(i).Caption = Int(Rnd * 100) + 1 Next i Option1(Int(Rnd * 4)).Caption = z End Select End If End If If y >= 7 Then Command1.Enabled = False Command2.Enabled = True End If If x >= 1 Then Picture1(k).Picture = LoadPicture("f:\程序设计2\图片\图片\xiaolian.jpg") End If End Sub Private Sub Command3_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single) For i = 0 To 3 Option1(i).Value = False Next i End Sub Private Sub Command4_Click() Hide form2.Show End Sub Private Sub Form_Load() For i = 1 To 8 Picture1(i).Picture = LoadPicture("f:\程序设计2\图片\蓝背景2.jpg") Next i Me.Picture = LoadPicture("f:\程序设计2\图片\2.jpg") For i = 0 To 3 Option1(i).Value = False Next i Randomize a = Int(Rnd * 50) + 1 b = Int(Rnd * 50) + 1 c = Int(Rnd * 2) + 1 Select Case c Case 1 Label1.Caption = a Label3.Caption = b Label2.Caption = "+" z = a + b For i = 0 To 3 Option1(i).Caption = Int(Rnd * 100) + 1 Next i Option1(Int(Rnd * 4)).Caption = z Case 2 If a < b Then t = b: b = a: a = t End If Label1.Caption = a Label3.Caption = b Label2.Caption = "-" z = a - b For i = 0 To 3 Option1(i).Caption = Int(Rnd * 100) + 1 Next i Option1(Int(Rnd * 4)).Caption = z End Select End Sub Private Sub Form5_Load() a = Int(Rnd * 50) + 1 b = Int(Rnd * 50) + 1 c = Int(Rnd * 2) + 1 Label1.Caption = a Label3.Caption = b Select Case c Case 1 Label2.Caption = "+" z = a + b For i = 0 To 3 Option1(i).Caption = Int(Rnd * 100) + 1 Next i Option1(Int(Rnd * 4)).Caption = z Case 2 If a < b Then t = b: b = a: a = t End If Label2.Caption = "-" z = a - b For i = 0 To 3 Option1(i).Caption = Int(Rnd * 100) + 1 Next i Option1(Int(Rnd * 4)).Caption = z End Select Label4.Caption = "=" End Sub Private Sub Option1_Click(Index As Integer) If y = 7 Then Picture1(8).Picture = LoadPicture("f:\程序设计2\图片\机器猫.jpg") For i = 0 To 3 Option1(i).Visible = False Next i Label1.Caption = "" Label2.Caption = "" Label3.Caption = "" Label4.Caption = "" End If If Option1(Index).Caption = z Then x = x + 1 k = y + 1 End If End Sub
首页 1 2 下一页