- VERSION 5.00
- Object = "{27395F88-0C0C-101B-A3C9-08002B2F49FB}#1.1#0"; "PICCLP32.OCX"
- Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "comdlg32.ocx"
- Begin VB.Form Form1
- AutoRedraw = -1 'True
- BackColor = &H8000000B&
- Caption = "拼图"
- ClientHeight = 9360
- ClientLeft = 810
- ClientTop = 945
- ClientWidth = 14010
- LinkTopic = "Form1"
- ScaleHeight = 9360
- ScaleWidth = 14010
- Begin MSComDlg.CommonDialog CommonDialog1
- Left = 12360
- Top = 7800
- _ExtentX = 847
- _ExtentY = 847
- _Version = 393216
- End
- Begin VB.CommandButton Command5
- Caption = "选择图片"
- BeginProperty Font
- Name = "楷体_GB2312"
- Size = 14.25
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 855
- Left = 12240
- TabIndex = 6
- Top = 2640
- Width = 855
- End
- Begin VB.CommandButton Command4
- Caption = "调试"
- BeginProperty Font
- Name = "楷体_GB2312"
- Size = 15.75
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 495
- Left = 12240
- TabIndex = 5
- Top = 720
- Width = 855
- End
- Begin VB.CommandButton Command3
- Caption = "查看原图"
- BeginProperty Font
- Name = "楷体_GB2312"
- Size = 14.25
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 855
- Left = 12240
- TabIndex = 4
- Top = 3600
- Width = 855
- End
- Begin VB.CommandButton Command2
- Caption = "退出"
- BeginProperty Font
- Name = "楷体_GB2312"
- Size = 15.75
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 615
- Left = 12120
- TabIndex = 3
- Top = 4680
- Width = 1095
- End
- Begin PicClip.PictureClip PictureClip1
- Left = 1080
- Top = 9360
- _ExtentX = 21167
- _ExtentY = 15875
- _Version = 393216
- Rows = 3
- Cols = 3
- Picture = "拼图(1).frx":0000
- End
- Begin VB.CommandButton Command1
- Caption = "开始"
- BeginProperty Font
- Name = "楷体_GB2312"
- Size = 15.75
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 735
- Left = 12120
- TabIndex = 2
- Top = 1560
- Width = 1095
- End
- Begin VB.Image Image1
- Height = 3135
- Index = 8
- Left = 8040
- Stretch = -1 'True
- Top = 6240
- Width = 3975
- End
- Begin VB.Image Image1
- Height = 3135
- Index = 7
- Left = 4080
- Stretch = -1 'True
- Top = 6240
- Width = 3975
- End
- Begin VB.Image Image1
- Height = 3135
- Index = 6
- Left = 120
- Stretch = -1 'True
- Top = 6240
- Width = 3975
- End
- Begin VB.Image Image1
- Height = 3135
- Index = 5
- Left = 8040
- Stretch = -1 'True
- Top = 3120
- Width = 3975
- End
- Begin VB.Image Image1
- Height = 3135
- Index = 4
- Left = 4080
- Stretch = -1 'True
- Top = 3120
- Width = 3975
- End
- Begin VB.Image Image1
- Height = 3135
- Index = 3
- Left = 120
- Stretch = -1 'True
- Top = 3120
- Width = 3975
- End
- Begin VB.Image Image1
- Height = 3135
- Index = 2
- Left = 8040
- Stretch = -1 'True
- Top = 0
- Width = 3975
- End
- Begin VB.Image Image1
- Height = 3135
- Index = 1
- Left = 4080
- Stretch = -1 'True
- Top = 0
- Width = 3975
- End
- Begin VB.Image Image1
- Height = 3135
- Index = 0
- Left = 120
- Stretch = -1 'True
- Top = 0
- Width = 3975
- End
- Begin VB.Label Label2
- Caption = "0"
- BeginProperty Font
- Name = "楷体_GB2312"
- Size = 15
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 615
- Left = 12120
- TabIndex = 1
- Top = 6840
- Width = 1095
- End
- Begin VB.Label Label1
- Caption = "步数"
- BeginProperty Font
- Name = "楷体_GB2312"
- Size = 15.75
- Charset = 134
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- Height = 615
- Left = 12120
- TabIndex = 0
- Top = 6000
- Width = 1095
- End
- Begin VB.Menu xyx
- Caption = "新游戏"
- End
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Public s As String
- Dim i As Integer
- Dim m As Integer
- Dim j As Integer
- Dim step As Integer
- Dim pan As Boolean
- Dim x(8) As Integer
- Sub win()
- For i = 0 To 7
- If Image1(i).Picture = PictureClip1.GraphicCell(i) Then
- pan = True
- Else: pan = False
- Exit For
- End If
- Next i
- If pan = True Then
- MsgBox ("恭喜你,成功了!")
- Command1.Enabled = True
- End If
- End Sub
- Sub init()
- For i = 0 To 7
- qin: x(i) = Int(Rnd * 8)
- For j = 0 To i - 1
- If x(i) = x(j) Then GoTo qin
- Next
- Next
- For i = 0 To 7
- Image1(i).Enabled = True
- Image1(x(i)).Picture = PictureClip1.GraphicCell(i)
- Next
- Image1(8).Picture = LoadPicture("")
- m = 0
- Label2.Caption = Str(m)
- End Sub
- Private Sub Command1_Click()
- init
- Command1.Enabled = False
- Label2.Caption = Str(m)
- End Sub
- Private Sub Command2_Click()
- End
- End Sub
- Private Sub Command3_Click()
- Form2.Show
- End Sub
- Private Sub Command4_Click()
- For i = 0 To 7
- Image1(i).Picture = PictureClip1.GraphicCell(i)
- Next i
- Image1(i).Picture = LoadPicture("")
- win
- Command1.Enabled = True
- End Sub
- Private Sub Command5_Click()
- CommonDialog1.Filter = "位图(*.bmp;*.dib)|*.bmp;*.dib|GIF图像(*.gif)|*.gif|JPEG图像(*.jpg)|*.jpg|元文件(*.wmf;*.emf)|*.wmf;*.emf|Ionc(*.ico;*.cur)|*.ico;*.cur|所有文件(*.*)|*.*"
- CommonDialog1.FilterIndex = 6
- CommonDialog1.ShowOpen
- s = CommonDialog1.FileName
- If s <> "" Then
- PictureClip1.Picture = LoadPicture(s)
- init
- End If
- End Sub
- Private Sub Form_Load()
- pan = False
- m = 0
- End Sub
- Private Sub Image1_Click(Index As Integer)
- If Command1.Enabled = False Then
- m = m + 1
- End If
- Select Case Index Mod 3
- Case 0
- If Image1(Index + 1).Picture = LoadPicture("") Then
- Image1(Index + 1).Picture = Image1(Index).Picture
- Image1(Index).Picture = LoadPicture("")
- Label2.Caption = Str(m)
- win
- End If
- Case 1
- If Image1(Index + 1).Picture = LoadPicture("") Then
- Image1(Index + 1).Picture = Image1(Index).Picture
- Image1(Index).Picture = LoadPicture("")
- Label2.Caption = Str(m)
- win
- End If
- If Image1(Index - 1).Picture = LoadPicture("") Then
- Image1(Index - 1).Picture = Image1(Index).Picture
- Image1(Index).Picture = LoadPicture("")
- Label2.Caption = Str(m)
- win
- End If
- Case 2
- If Image1(Index - 1).Picture = LoadPicture("") Then
- Image1(Index - 1).Picture = Image1(Index).Picture
- Image1(Index).Picture = LoadPicture("")
- Label2.Caption = Str(m)
- win
- End If
- End Select
- Select Case Index 3
- Case 0
- If Image1(Index + 3).Picture = LoadPicture("") Then
- Image1(Index + 3).Picture = Image1(Index).Picture
- Image1(Index).Picture = LoadPicture("")
- Label2.Caption = Str(m)
- win
- End If
- Case 1
- If Image1(Index - 3).Picture = LoadPicture("") Then
- Image1(Index - 3).Picture = Image1(Index).Picture
- Image1(Index).Picture = LoadPicture("")
- Label2.Caption = Str(m)
- win
- End If
- If Image1(Index + 3).Picture = LoadPicture("") Then
- Image1(Index + 3).Picture = Image1(Index).Picture
- Image1(Index).Picture = LoadPicture("")
- Label2.Caption = Str(m)
- win
- End If
- Case 2
- If Image1(Index - 3).Picture = LoadPicture("") Then
- Image1(Index - 3).Picture = Image1(Index).Picture
- Image1(Index).Picture = LoadPicture("")
- Label2.Caption = Str(m)
- win
- End If
- End Select
- End Sub
- Private Sub xyx_Click()
- init
- Command1.Enabled = False
- Label2.Caption = Str(m)
- End Sub