PDA

View Full Version : سوال : سوال در مورد یک مسئله قدیمی ...



Hamedm
پنج شنبه 08 بهمن 1383, 12:35 عصر
سلام

امروز یکی از دوستان به من PM زد و یک برنامه خواست که براش بنویسم. من هم که یک پروژه دستمه که باید تا آخر تعطیلات عید تموم کنم روم نشد بهش بگم من وقت ندارم. البته برنامه اش کاری نداره. 2 الی 3 ساعته تموم میشه.
اگر بخوام 2 ای 3 ساعت روی این برنامه تمرکز کنم ریشه افکارم پاره میشه و از پروژه خودم دور میشم.
بخاطر همین از شما تقاضا دارم اگر کسی از قبل این برنامه رو نوشته برای من ارسال کنه.
برنامه این است:
برنامه ای بنویسید که کاربر مختصات یک خونه شطرنج رو به برنامه بده و برنامه از اون نقطه حرکت یک اسب رو شروع کنه به طوری که اسب روی تمام خونه های شطرنج حرکت کنه. یعنی بجز خونه اول در عرض 63 حرکت تمام خونه ها رو رفته باشه. البته اسب نباید روی خونه ای بره که قبلا رفته.

منتظر پاسختان هستم
موفق باشید و پرتوان

a_roshanfekr2
شنبه 10 بهمن 1383, 08:52 صبح
اگه فکر می کنی دو ساعته می شه نوشتش کارت خیلی درسته
روش اجرا:
ورود شماره سطر و ستون
دکمه محاسبه حرکت اسبها
دکمه جایگذاری اسبها



VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 5670
ClientLeft = 60
ClientTop = 345
ClientWidth = 6840
LinkTopic = "Form1"
ScaleHeight = 5670
ScaleWidth = 6840
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton Command3
Caption = "جایگداری اسبها"
BeginProperty Font
Name = "Arial"
Size = 9.75
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 390
Left = 4305
TabIndex = 86
Top = 4965
Width = 1350
End
Begin VB.CommandButton Command2
BackColor = &H8000000A&
Caption = "پاک کردن صفحه"
BeginProperty Font
Name = "Arial"
Size = 9.75
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 1110
TabIndex = 85
Top = 4950
Width = 1335
End
Begin VB.TextBox Text2
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 330
Left = 3375
TabIndex = 0
Top = 4500
Width = 660
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 330
Left = 1440
TabIndex = 1
Top = 4500
Width = 660
End
Begin VB.CommandButton Command1
BackColor = &H8000000A&
Caption = "محاسبه حرکت اسبها"
BeginProperty Font
Name = "Arial"
Size = 9.75
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2595
TabIndex = 3
Top = 4965
Width = 1575
End
Begin VB.Label Label2
Caption = "8"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000080&
Height = 210
Index = 15
Left = 5220
TabIndex = 84
Top = 285
Width = 180
End
Begin VB.Label Label2
Caption = "7"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000080&
Height = 210
Index = 14
Left = 4665
TabIndex = 83
Top = 285
Width = 180
End
Begin VB.Label Label2
Caption = "6"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000080&
Height = 210
Index = 13
Left = 4095
TabIndex = 82
Top = 285
Width = 180
End
Begin VB.Label Label2
Caption = "5"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000080&
Height = 210
Index = 12
Left = 3540
TabIndex = 81
Top = 285
Width = 180
End
Begin VB.Label Label2
Caption = "4"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000080&
Height = 210
Index = 11
Left = 2985
TabIndex = 80
Top = 285
Width = 180
End
Begin VB.Label Label2
Caption = "3"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000080&
Height = 210
Index = 10
Left = 2430
TabIndex = 79
Top = 285
Width = 180
End
Begin VB.Label Label2
Caption = "2"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000080&
Height = 210
Index = 9
Left = 1860
TabIndex = 78
Top = 285
Width = 180
End
Begin VB.Label Label2
Caption = "1 "
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000080&
Height = 210
Index = 8
Left = 1335
TabIndex = 77
Top = 285
Width = 150
End
Begin VB.Label Label2
Caption = "8"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000080&
Height = 210
Index = 7
Left = 750
TabIndex = 76
Top = 3990
Width = 180
End
Begin VB.Label Label2
Caption = "7"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000080&
Height = 210
Index = 6
Left = 750
TabIndex = 75
Top = 3510
Width = 180
End
Begin VB.Label Label2
Caption = "6"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000080&
Height = 210
Index = 5
Left = 750
TabIndex = 74
Top = 3030
Width = 180
End
Begin VB.Label Label2
Caption = "5"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000080&
Height = 210
Index = 4
Left = 750
TabIndex = 73
Top = 2565
Width = 180
End
Begin VB.Label Label2
Caption = "4"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000080&
Height = 210
Index = 3
Left = 750
TabIndex = 72
Top = 2085
Width = 180
End
Begin VB.Label Label2
Caption = "3"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000080&
Height = 210
Index = 2
Left = 750
TabIndex = 71
Top = 1605
Width = 180
End
Begin VB.Label Label2
Caption = "2"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000080&
Height = 210
Index = 1
Left = 750
TabIndex = 70
Top = 1140
Width = 180
End
Begin VB.Label Label4
Caption = " شروع از سطر"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 4050
TabIndex = 69
Top = 4530
Width = 1080
End
Begin VB.Label Label2
Caption = "1 "
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000080&
Height = 210
Index = 0
Left = 765
TabIndex = 68
Top = 660
Width = 150
End
Begin VB.Label Label1
Caption = "ستون"
BeginProperty Font
Name = "Arial"
Size = 9
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 270
Left = 2205
TabIndex = 67
Top = 4545
Width = 375
End
Begin VB.Shape Shape1
BorderWidth = 2
Height = 3735
Left = 1110
Top = 600
Width = 4575
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 56
Left = 1110
TabIndex = 66
Top = 3870
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 57
Left = 1680
TabIndex = 65
Top = 3870
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 58
Left = 2250
TabIndex = 64
Top = 3870
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 59
Left = 2820
TabIndex = 63
Top = 3870
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 60
Left = 3390
TabIndex = 62
Top = 3870
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 61
Left = 3960
TabIndex = 61
Top = 3870
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 62
Left = 4530
TabIndex = 60
Top = 3870
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 63
Left = 5100
TabIndex = 59
Top = 3870
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 48
Left = 1110
TabIndex = 58
Top = 3405
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 49
Left = 1680
TabIndex = 57
Top = 3405
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 50
Left = 2250
TabIndex = 56
Top = 3405
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 51
Left = 2820
TabIndex = 55
Top = 3405
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 52
Left = 3390
TabIndex = 54
Top = 3405
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 53
Left = 3960
TabIndex = 53
Top = 3405
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 54
Left = 4530
TabIndex = 52
Top = 3405
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00000000&
Height = 450
Index = 55
Left = 5100
TabIndex = 51
Top = 3405
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 40
Left = 1110
TabIndex = 50
Top = 2940
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 41
Left = 1680
TabIndex = 49
Top = 2940
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 42
Left = 2250
TabIndex = 48
Top = 2940
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 43
Left = 2820
TabIndex = 47
Top = 2940
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 44
Left = 3390
TabIndex = 46
Top = 2940
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 45
Left = 3960
TabIndex = 45
Top = 2940
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 46
Left = 4530
TabIndex = 44
Top = 2940
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 47
Left = 5100
TabIndex = 43
Top = 2940
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 32
Left = 1110
TabIndex = 42
Top = 2475
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 33
Left = 1680
TabIndex = 41
Top = 2475
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 34
Left = 2250
TabIndex = 40
Top = 2475
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 35
Left = 2820
TabIndex = 39
Top = 2475
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 36
Left = 3390
TabIndex = 38
Top = 2475
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 37
Left = 3960
TabIndex = 37
Top = 2475
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 38
Left = 4530
TabIndex = 36
Top = 2475
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 39
Left = 5100
TabIndex = 35
Top = 2475
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 24
Left = 1110
TabIndex = 34
Top = 2010
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 25
Left = 1680
TabIndex = 33
Top = 2010
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 26
Left = 2250
TabIndex = 32
Top = 2010
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 27
Left = 2820
TabIndex = 31
Top = 2010
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 28
Left = 3390
TabIndex = 30
Top = 2010
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 29
Left = 3960
TabIndex = 29
Top = 2010
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 30
Left = 4530
TabIndex = 28
Top = 2010
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 31
Left = 5115
TabIndex = 27
Top = 2010
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 16
Left = 1110
TabIndex = 26
Top = 1545
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 17
Left = 1680
TabIndex = 25
Top = 1545
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 18
Left = 2250
TabIndex = 24
Top = 1545
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 19
Left = 2820
TabIndex = 23
Top = 1545
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 20
Left = 3390
TabIndex = 22
Top = 1545
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 21
Left = 3960
TabIndex = 21
Top = 1545
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 22
Left = 4530
TabIndex = 20
Top = 1545
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 23
Left = 5100
TabIndex = 19
Top = 1545
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 8
Left = 1110
TabIndex = 18
Top = 1080
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 9
Left = 1680
TabIndex = 17
Top = 1080
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 10
Left = 2250
TabIndex = 16
Top = 1080
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 11
Left = 2820
TabIndex = 15
Top = 1080
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 12
Left = 3390
TabIndex = 14
Top = 1080
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 13
Left = 3960
TabIndex = 13
Top = 1080
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 14
Left = 4530
TabIndex = 12
Top = 1080
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 15
Left = 5100
TabIndex = 11
Top = 1080
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 0
Left = 1110
TabIndex = 10
Top = 615
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 1
Left = 1680
TabIndex = 9
Top = 615
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 2
Left = 2250
TabIndex = 8
Top = 615
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 3
Left = 2820
TabIndex = 7
Top = 615
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 4
Left = 3390
TabIndex = 6
Top = 615
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 5
Left = 3960
TabIndex = 5
Top = 615
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00800000&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H00FFFFFF&
Height = 450
Index = 6
Left = 4530
TabIndex = 4
Top = 615
Width = 555
End
Begin VB.Label L1
Alignment = 2 'Center
BackColor = &H00E0E0E0&
BeginProperty Font
Name = "Courier New"
Size = 14.25
Charset = 178
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 450
Index = 7
Left = 5100
TabIndex = 2
Top = 615
Width = 555
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim a(8) As Integer, mark(8, 8), num1 As Integer

Function F_Move() As Integer

Dim i, low, mini
low = a(0)
For i = 1 To 7
If low >= a(i) Then
If a(i) <> -1 Then low = a(i)
End If
Next

For i = 0 To 7
If a(i) = low Then
mini = i
Exit For
End If
Next
F_Move = mini

End Function

Private Sub Command1_Click()
Dim Mov1(7), Mov2(7)
Mov1(0) = -2
Mov1(1) = -1
Mov1(2) = 1
Mov1(3) = 2
Mov1(4) = 2
Mov1(5) = 1
Mov1(6) = -1
Mov1(7) = -2

Mov2(0) = 1
Mov2(1) = 2
Mov2(2) = 2
Mov2(3) = 1
Mov2(4) = -1
Mov2(5) = -2
Mov2(6) = -2
Mov2(7) = -1
Dim chess1(8, 8)
Dim i, j, k, l, m, low, n, pos, sW, t1, t2, x, y, nexi(8), nexj(8), exit1(8), cH As String
sW = 1
For i = 0 To 7
For j = 0 To 7
mark(i, j) = 0
exit1(j) = -1
nexi(j) = nexj(j) = 0
Next
Next

If Text2 = "" Then
MsgBox "خطا --- عددی بین یک و هشت وارد نمایید"
Text2.SetFocus
Exit Sub
Else
If IsNumeric(Text2) = False Then
MsgBox "خطا --- عددی بین یک و هشت وارد نمایید"
Text2.SetFocus
Exit Sub
Else
If Text2.Text > 8 Or Text2.Text < 1 Then
MsgBox "خطا --- عددی بین یک و هشت وارد نمایید"
Text2.SetFocus
Exit Sub
End If
End If
End If
x = Text2 - 1

If Text1 = "" Then
MsgBox "خطا --- عددی بین یک و هشت وارد نمایید"
Text1.SetFocus
Exit Sub
Else
If IsNumeric(Text1) = False Then
MsgBox "خطا --- عددی بین یک و هشت وارد نمایید"
Text1.SetFocus
Exit Sub
Else
If Text1.Text > 8 Or Text1.Text < 1 Then
MsgBox "خطا --- عددی بین یک و هشت وارد نمایید"
Text1.SetFocus
Exit Sub
End If
End If
End If
y = Text1 - 1
mark(x, y) = 1
m = 2
While m <= 64
pos = 8
l = 0
For i = 0 To 7
nexi(i) = nexj(i) = 0
Next
For k = 0 To 7
t1 = x + Mov1(k)
t2 = y + Mov2(k)
If t1 > 7 Or t2 > 7 Or t1 < 0 Or t2 < 0 Then
pos = pos - 1
Else
If mark(t1, t2) <> 0 Then
pos = pos - 1
Else
nexi(l) = t1
nexj(l) = t2
l = l + 1
End If
End If
Next
For i = 0 To 7
exit1(i) = -1
If pos = 0 Then
Exit For
End If
Next
For l = 0 To pos - 1
n = 8
For k = 0 To 7
t1 = nexi(l) + Mov1(k)
t2 = nexj(l) + Mov2(k)
If t1 > 7 Or t2 > 7 Or t1 < 0 Or t2 < 0 Then
n = n - 1
Else
If mark(t1, t2) <> 0 Then n = n - 1
End If
Next
exit1(l) = n
Next
a(0) = exit1(0)
a(1) = exit1(1)
a(2) = exit1(2)
a(3) = exit1(3)
a(4) = exit1(4)
a(5) = exit1(5)
a(6) = exit1(6)
a(7) = exit1(7)
low = F_Move()
x = nexi(low)
y = nexj(low)
mark(x, y) = m

m = m + 1

Wend

num1 = 1
End Sub

Private Sub Command2_Click()
Dim L1_no As Integer
L1_no = 0
For i = 0 To 7
For j = 0 To 7
L1(L1_no).Caption = ""
L1(L1_no).Refresh
L1_no = L1_no + 1
Next
Next
Command1_Click
End Sub

Private Sub sss()
Dim L1_no As Integer
L1_no = 0
For i = 0 To 7
For j = 0 To 7
If num1 = mark(i, j) Then
L1(L1_no).Caption = Trim(Str(mark(i, j)))
L1(L1_no).Refresh
End If
L1_no = L1_no + 1

Next
Next
num1 = num1 + 1
SSD = 0
End Sub

Private Sub Command3_Click()
sss
End Sub

Hamedm
شنبه 10 بهمن 1383, 12:03 عصر
a_roshanfekr2 جان دستت درد نکنه واقعا شرمندم کردی چون توی بد مخمصه ای گیرکرده بود. اصلا روم نمیشد به دوستم بگم اصلا وقت ندارم.

بازهم از شما تشکر میکنم

موفق باشید و پرتوان :flower:

ساران سافت
شنبه 10 بهمن 1383, 17:55 عصر
بجای این همه کد نویسی فایلشو میذاشتی که راحتتر بودی :wink: :wise1:

a_roshanfekr2
سه شنبه 13 بهمن 1383, 13:46 عصر
دشمنت شرمنده
بعد از اینکه ارسال کردم فهمیدم می شه فایل رو ارسال کرد
حالم گرفته شد( آخه سوتی ناجوری بود)
قول می دم دیگه تکرار نشه