-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPath.C
More file actions
92 lines (76 loc) · 1.79 KB
/
Copy pathPath.C
File metadata and controls
92 lines (76 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/**********************************************************
*Copyright(c) Automation Excellence Class
*FileName: Path.c
*Author: SYC
*Date: 2017/09/11
*Description: 所有路径存储
*Others: 把路径写成数组然后存到文件里面,初始化路径
*Function List:
1.fread
2.fwrite
3.
*History:
1.Date:
Author:
Modification:
**********************************************************/
#include "Path.h"
void Get_Path(char P[],int start,int end)
{
int i;
const char path[7][6][7]={
{ {0, 3, 5, 4, 1, -1, -1},
{0, 3, 5, 7, 8, 2, -1},
{0, 3, 5, 7, 8, 9, -1},
{0, 3, 5, 6,11, 10, -1},
{0, 3, 5, 7, 8,12, 13},
{0, 3, 5, 6, 11, 14, -1}},
{ {1, 4, 5, 3, 0, -1, -1},
{1, 4, 5, 7, 8, 2, -1},
{1, 4, 5, 7, 8, 9, -1},
{1, 4, 5, 6,11, 10, -1},
{1, 4, 5, 7, 8,12, 13},
{1, 4, 5, 6, 11, 14, -1}},
{ {2, 8, 7, 5, 3, 0, -1},
{2, 8, 7, 5, 4, 1, -1},
{2, 8, 9, -1, -1, -1, -1},
{2, 8, 12, 11,10, -1, -1},
{2, 8, 12, 13, -1,-1, -1},
{2, 8, 12, 11, 14, -1, -1}},
{ {9, 8, 7, 5, 3, 0, -1},
{9, 8, 7, 5, 4, 1, -1},
{9, 8, 2, -1, -1, -1, -1},
{9, 8, 12, 11,10, -1, -1},
{9, 8, 12, 13, -1,-1, -1},
{9, 8, 12, 11, 14, -1, -1}},
{ {10, 11, 6, 5, 3, 0, -1},
{10, 11, 6, 5, 4, 1, -1},
{10, 11, 12, 8, 2, -1, -1},
{10, 11, 12, 8, 9, -1, -1},
{10, 11, 12, 13, -1, -1, -1},
{10, 11, 14, -1, -1, -1, -1}},
{ {13, 12 ,8, 7, 5, 3, 0},
{13, 12, 8, 7, 5, 4, 1},
{13, 12, 8, 2, -1, -1, -1},
{13, 12, 8, 9, -1, -1, -1},
{13, 12, 11, 10, -1,-1, -1},
{13, 12, 11, 14, -1, -1, -1}},
{ {14, 11 ,6, 5, 3, 0, -1},
{14, 11, 6, 5, 4, 1, -1},
{14, 11, 12, 8, 2, -1, -1},
{14, 11, 12, 8, 9, -1, -1},
{14, 11, 10, -1, -1,-1, -1},
{14, 11, 12, 13, -1, -1, -1}}
};
if(start<0||start>6||end<0||end>6)
{
exit(0);
}
else
{
for(i=0;i<7;i++)
{
P[i]=path[start][end][i];
}
}
}