|
แจก Source Code เกมส์ Puzza
คงไม่ต้อง Download แค่ Copy ใส่ Form VB6 เ่ท่านั้น...
Dim H As Integer Dim OK As Boolean
Private Sub Command1_Click(Index As Integer) If Command1(Index).Caption <> Empty Then If Int(Index / 4) = Int(H / 4) Then If Index + 3 = H Then Command1(Index + 3).Caption = Command1(Index + 2).Caption Command1(Index + 2).Caption = Command1(Index + 1).Caption Command1(Index + 1).Caption = Command1(Index).Caption ElseIf Index - 3 = H Then Command1(Index - 3).Caption = Command1(Index - 2).Caption Command1(Index - 2).Caption = Command1(Index - 1).Caption Command1(Index - 1).Caption = Command1(Index).Caption ElseIf Index + 2 = H Then Command1(Index + 2).Caption = Command1(Index + 1).Caption Command1(Index + 1).Caption = Command1(Index).Caption ElseIf Index - 2 = H Then Command1(Index - 2).Caption = Command1(Index - 1).Caption Command1(Index - 1).Caption = Command1(Index).Caption ElseIf Index + 1 = H Or Index - 1 = H Then Command1(H).Caption = Command1(Index).Caption End If Command1(Index).Caption = Empty H = Index ElseIf Index Mod 4 = H Mod 4 Then If Index + 12 = H Then Command1(Index + 12).Caption = Command1(Index + 8).Caption Command1(Index + 8).Caption = Command1(Index + 4).Caption Command1(Index + 4).Caption = Command1(Index).Caption ElseIf Index - 12 = H Then Command1(Index - 12).Caption = Command1(Index - 8).Caption Command1(Index - 8).Caption = Command1(Index - 4).Caption Command1(Index - 4).Caption = Command1(Index).Caption ElseIf Index + 8 = H Then Command1(Index + 8).Caption = Command1(Index + 4).Caption Command1(Index + 4).Caption = Command1(Index).Caption ElseIf Index - 8 = H Then Command1(Index - 8).Caption = Command1(Index - 4).Caption Command1(Index - 4).Caption = Command1(Index).Caption ElseIf Index + 4 = H Or Index - 4 = H Then Command1(H).Caption = Command1(Index).Caption End If Command1(Index).Caption = Empty H = Index End If OK = True For N = 0 To 14 If Command1(N).Caption <> Trim(Str(N + 1)) Then OK = False Next N If OK Then MsgBox "ÊÓàÃç¨áÅéÇ": Call Form_Load End If End Sub
Private Sub Form_Load() Randomize For N = 0 To 15 Command1(N).Caption = Empty Next N For N = 0 To 14 Do R = ((Rnd * 100) Mod 15) Loop While Command1(R).Caption <> Empty Command1(R).Caption = N + 1 Next N H = 15 End Sub
Create Date : 13 กรกฎาคม 2554 |
Last Update : 4 พฤษภาคม 2556 17:09:32 น. |
|
0 comments
|
Counter : 1261 Pageviews. |
|
|
|
| |
|
|