 
                    
                
         
    
    
    
	
	
		
		    
        
        连连看自动寻道算法
    
 连连看自动寻道算法
连连看自动寻道算法 

 onClipEvent (load)
onClipEvent (load)  {
{ 
 _root.yb._alpha = 0;
_root.yb._alpha = 0; 
 var zt = new Array();
var zt = new Array(); 
 var jilu1 = new Array();
var jilu1 = new Array(); 
 var jilu2 = new Array();
var jilu2 = new Array(); 
 var jilu3 = new Array();
var jilu3 = new Array(); 
 var jilu4 = new Array();
var jilu4 = new Array(); 
 b = 0;
b = 0; 
 val = 1;
val = 1; 

 for (i=0; i<12; i++)
for (i=0; i<12; i++)  {
{ 

 for (j=0; j<12; j++)
for (j=0; j<12; j++)  {
{ 
 a = attachMovie("ttt", "ttt"+val, val);
a = attachMovie("ttt", "ttt"+val, val); 
 a._x = j*32-50;
a._x = j*32-50; 
 a._y = i*32-80;
a._y = i*32-80; 
 a.onPress = pres;
a.onPress = pres; 
 a.onRollOut = rele;
a.onRollOut = rele; 
 a.n = val;
a.n = val; 
 zt[val] = 1;
zt[val] = 1; 
 //初始为第一帧;
//初始为第一帧; 
 val++;
val++; 
 }
} 
 }
} 

 for (i=1; i<=12; i++)
for (i=1; i<=12; i++)  {
{ 

 tellTarget ("ttt"+i)
tellTarget ("ttt"+i)  {
{ 
 gotoAndStop(9);
gotoAndStop(9); 
 }
} 
 zt[i] = 9;
zt[i] = 9; 
 }
} 

 for (i=133; i<=144; i++)
for (i=133; i<=144; i++)  {
{ 

 tellTarget ("ttt"+i)
tellTarget ("ttt"+i)  {
{ 
 gotoAndStop(9);
gotoAndStop(9); 
 }
} 
 zt[i] = 9;
zt[i] = 9; 
 }
} 

 for (i=1; i<=133; i=i+12)
for (i=1; i<=133; i=i+12)  {
{ 

 tellTarget ("ttt"+i)
tellTarget ("ttt"+i)  {
{ 
 gotoAndStop(9);
gotoAndStop(9); 
 }
} 
 zt[i] = 9;
zt[i] = 9; 
 }
} 

 for (i=12; i<=144; i=i+12)
for (i=12; i<=144; i=i+12)  {
{ 

 tellTarget ("ttt"+i)
tellTarget ("ttt"+i)  {
{ 
 gotoAndStop(9);
gotoAndStop(9); 
 }
} 
 zt[i] = 9;
zt[i] = 9; 
 }
} 

 for (i=1; i<=137; i++)
for (i=1; i<=137; i++)  {
{ 

 if (zt[i] != 9)
if (zt[i] != 9)  {
{ 
 ra = random(10)+1;
ra = random(10)+1; 
 zt[i] = ra;
zt[i] = ra; 
 selectframe(ra);
selectframe(ra); 
 }
} 
 }
} 
 //列出矩阵;
//列出矩阵; 

 function pres()
function pres()  {
{ 
 t = this.n;
t = this.n; 

 if (b != 0)
if (b != 0)  {
{ 
 _root.yb._alpha = 0;
_root.yb._alpha = 0; 
 //c2=this._currentframe;
//c2=this._currentframe; 
 first = b;
first = b; 
 second = this.n;
second = this.n; 
 ss=zt[second];
ss=zt[second]; 

 if(bb==ss)
if(bb==ss) {
{ 
 //记录判断点类型;
//记录判断点类型; 
 line1_x = getProperty("ttt"+first, _x);
line1_x = getProperty("ttt"+first, _x); 
 line1_y = getProperty("ttt"+first, _y);
line1_y = getProperty("ttt"+first, _y); 
 line2_x = getProperty("ttt"+second, _x);
line2_x = getProperty("ttt"+second, _x); 
 line2_y = getProperty("ttt"+second, _y);
line2_y = getProperty("ttt"+second, _y); 

 if (line1_x == line2_x)
if (line1_x == line2_x)  {
{ 
 line4 = "同一列";
line4 = "同一列"; 
 _root.control.panduan_lie();
_root.control.panduan_lie(); 

 } else if (line1_y == line2_y)
} else if (line1_y == line2_y)  {
{ 
 _root.control.panduan_hang();
_root.control.panduan_hang(); 
 line4 = "同一行";
line4 = "同一行"; 

 } else
} else  {
{ 
 _root.control.panduan_cuowei();
_root.control.panduan_cuowei(); 
 line4 = "错开位";
line4 = "错开位"; 
 }
} 
 }
} 
 //判断两个点是否在同一列上;
//判断两个点是否在同一列上; 
 //c=this._currentframe;
//c=this._currentframe; 
 b = 0;
b = 0; 

 } else
} else  {
{ 
 _root.yb._alpha = 50;
_root.yb._alpha = 50; 
 _root.yb._x = this._x+546;
_root.yb._x = this._x+546; 
 _root.yb._y = this._y+5;
_root.yb._y = this._y+5; 
 b = this.n;
b = this.n; 
 bb=zt[b];
bb=zt[b]; 
 //this.gotoandstop(2);
//this.gotoandstop(2); 
 c = this._currentframe;
c = this._currentframe; 
 }
} 
 }
} 

 function panduan_lie()
function panduan_lie()  {
{ 
 g = 1000;
g = 1000; 
 br = 0;
br = 0; 
 //两点在同一列上的处理函数;
//两点在同一列上的处理函数; 

 if (math.abs(first-second) == 12)
if (math.abs(first-second) == 12)  {
{ 
 _root.control.ok();
_root.control.ok(); 

 } else
} else  {
{ 
 //1
//1 
 line1 = Math.floor(first/12);
line1 = Math.floor(first/12); 
 line2 = Math.floor(second/12);
line2 = Math.floor(second/12); 

 for (i=1; i<=12; i++)
for (i=1; i<=12; i++)  {
{ 
 jilu1[i] = line1*12+i;
jilu1[i] = line1*12+i; 
 jilu2[i] = line2*12+i;
jilu2[i] = line2*12+i; 
 }
} 

 for (i=1; i<=12; i++)
for (i=1; i<=12; i++)  {
{ 
 //2
//2 

 if (jilu1[i] != first)
if (jilu1[i] != first)  {
{ 

 if (zt[jilu1[i]] == 9 and zt[jilu2[i]] == 9)
if (zt[jilu1[i]] == 9 and zt[jilu2[i]] == 9)  {
{ 
 l = jiance_lie1(jilu1[i], jilu2[i]);
l = jiance_lie1(jilu1[i], jilu2[i]); 

 if (l>0)
if (l>0)  {
{ 

 if (l<g)
if (l<g)  {
{ 
 g = l;
g = l; 
 g1 = jilu1[i];
g1 = jilu1[i]; 
 g2 = jilu2[i];
g2 = jilu2[i]; 
 }
} 
 //_root.control.ok();
//_root.control.ok(); 
 }
} 
 }
} 

 } else
} else  {
{ 
 l = jiance_lie2(jilu1[i], jilu2[i]);
l = jiance_lie2(jilu1[i], jilu2[i]); 

 if (l == 100)
if (l == 100)  {
{ 
 _root.control.shuxian0(jilu1[i], jilu2[i]);
_root.control.shuxian0(jilu1[i], jilu2[i]); 
 br = 1;
br = 1; 
 break;
break; 
 }
} 
 }
} 
 }
} 

 if (g != 1000 and br == 0)
if (g != 1000 and br == 0)  {
{ 
 guaixian2_lie(g1, g2);
guaixian2_lie(g1, g2); 
 }
} 
 //2
//2 
 }
} 
 //1
//1 
 }
} 

 function panduan_hang()
function panduan_hang()  {
{ 
 g = 1000;
g = 1000; 
 br = 0;
br = 0; 
 //两点在同一行上的处理函数;
//两点在同一行上的处理函数; 

 if (math.abs(first-second) == 1)
if (math.abs(first-second) == 1)  {
{ 
 _root.control.ok();
_root.control.ok(); 

 } else
} else  {
{ 
 line1 = first%12;
line1 = first%12; 
 line2 = second%12;
line2 = second%12; 

 for (i=1; i<=12; i++)
for (i=1; i<=12; i++)  {
{ 
 jilu1[i] = line1+(i-1)*12;
jilu1[i] = line1+(i-1)*12; 
 jilu2[i] = line2+(i-1)*12;
jilu2[i] = line2+(i-1)*12; 
 }
} 

 for (i=1; i<=12; i++)
for (i=1; i<=12; i++)  {
{ 

 if (jilu1[i] != first)
if (jilu1[i] != first)  {
{ 

 if (zt[jilu1[i]] == 9 and zt[jilu2[i]] == 9)
if (zt[jilu1[i]] == 9 and zt[jilu2[i]] == 9)  {
{ 
 f = jiance_hen1(jilu1[i], jilu2[i]);
f = jiance_hen1(jilu1[i], jilu2[i]); 

 if (f>0)
if (f>0)  {
{ 

 if (f<g)
if (f<g)  {
{ 
 g = f;
g = f; 
 g1 = jilu1[i];
g1 = jilu1[i]; 
 g2 = jilu2[i];
g2 = jilu2[i]; 
 }
} 
 }
} 
 }
} 

 } else
} else  {
{ 
 f = jiance_hen2(jilu1[i], jilu2[i]);
f = jiance_hen2(jilu1[i], jilu2[i]); 

 if (f == 100)
if (f == 100)  {
{ 
 _root.control.henxiang0(jilu1[i], jilu2[i]);
_root.control.henxiang0(jilu1[i], jilu2[i]); 
 br = 1;
br = 1; 
 break;
break; 
 }
} 
 }
} 
 }
} 
 }
} 

 if (g != 1000 and br == 0)
if (g != 1000 and br == 0)  {
{ 
 guaixian2_hen(g1, g2);
guaixian2_hen(g1, g2); 
 }
} 
 }
} 

 function jiance_hen1(x, y)
function jiance_hen1(x, y)  {
{ 
 //检测两点是否为通路的函数;
//检测两点是否为通路的函数; 
 p1 = 0;
p1 = 0; 
 p2 = 0;
p2 = 0; 
 p3 = 0;
p3 = 0; 
 co = 0;
co = 0; 

 if (x>y)
if (x>y)  {
{ 
 //1
//1 
 dis = x-y-1;
dis = x-y-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = x-z;
q = x-z; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p1++;
p1++; 
 }
} 
 }
} 

 } else
} else  {
{ 
 dis = y-x-1;
dis = y-x-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = y-z;
q = y-z; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p1++;
p1++; 
 }
} 
 }
} 
 }
} 
 //1
//1 

 if (p1 == dis)
if (p1 == dis)  {
{ 
 p1 = 100;
p1 = 100; 
 }
} 
 //横向检测;<-
//横向检测;<- 

 if (first>x)
if (first>x)  {
{ 
 dis = (first-x)/12-1;
dis = (first-x)/12-1; 

 if (dis == 0)
if (dis == 0)  {
{ 
 p2 = 100;
p2 = 100; 

 } else
} else  {
{ 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = first-z*12;
q = first-z*12; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p2++;
p2++; 
 }
} 
 }
} 
 }
} 

 } else
} else  {
{ 
 dis = (x-first)/12-1;
dis = (x-first)/12-1; 

 if (dis == 0)
if (dis == 0)  {
{ 
 p2 = 100;
p2 = 100; 

 } else
} else  {
{ 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = x-z*12;
q = x-z*12; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p2++;
p2++; 
 }
} 
 }
} 
 }
} 
 }
} 

 if (p2 == dis)
if (p2 == dis)  {
{ 
 p2 = 100;
p2 = 100; 
 }
} 

 if (second>y)
if (second>y)  {
{ 
 dis = (second-y)/12-1;
dis = (second-y)/12-1; 

 if (dis == 0)
if (dis == 0)  {
{ 
 p3 = 100;
p3 = 100; 

 } else
} else  {
{ 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = second-z*12;
q = second-z*12; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p3++;
p3++; 
 }
} 
 }
} 
 }
} 

 } else
} else  {
{ 
 dis = (y-second)/12-1;
dis = (y-second)/12-1; 

 if (dis == 0)
if (dis == 0)  {
{ 
 p3 = 100;
p3 = 100; 

 } else
} else  {
{ 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = y-z*12;
q = y-z*12; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p3++;
p3++; 
 }
} 
 }
} 
 }
} 
 }
} 

 if (p3 == dis)
if (p3 == dis)  {
{ 
 p3 = 100;
p3 = 100; 
 }
} 
 p = p1+p2+p3;
p = p1+p2+p3; 

 if (p == 300)
if (p == 300)  {
{ 
 co = math.abs(x-y)+math.abs(second-y)/12+math.abs(first-x)/12;
co = math.abs(x-y)+math.abs(second-y)/12+math.abs(first-x)/12; 
 }
} 
 return (co);
return (co); 
 }
} 

 function jiance_hen2(x, y)
function jiance_hen2(x, y)  {
{ 
 p4 = 0;
p4 = 0; 

 if (x>y)
if (x>y)  {
{ 
 dis = x-y-1;
dis = x-y-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = x-z;
q = x-z; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p4++;
p4++; 
 }
} 
 }
} 

 } else
} else  {
{ 
 dis = y-x-1;
dis = y-x-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = y-z;
q = y-z; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p4++;
p4++; 
 }
} 
 }
} 
 }
} 

 if (p4 == dis)
if (p4 == dis)  {
{ 
 p4 = 100;
p4 = 100; 
 }
} 
 return (p4);
return (p4); 
 }
} 

 function jiance_lie1(x, y)
function jiance_lie1(x, y)  {
{ 
 p1 = 0;
p1 = 0; 
 p2 = 0;
p2 = 0; 
 p3 = 0;
p3 = 0; 
 co = 0;
co = 0; 

 if (x>y)
if (x>y)  {
{ 
 dis = (x-y)/12-1;
dis = (x-y)/12-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = x-z*12;
q = x-z*12; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p1++;
p1++; 
 }
} 
 }
} 

 } else
} else  {
{ 
 dis = (y-x)/12-1;
dis = (y-x)/12-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = y-z*12;
q = y-z*12; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p1++;
p1++; 
 }
} 
 }
} 
 }
} 

 if (p1 == dis)
if (p1 == dis)  {
{ 
 p1 = 100;
p1 = 100; 
 }
} 
 //纵向检测《---
//纵向检测《--- 

 if (first>x)
if (first>x)  {
{ 
 dis = first-x-1;
dis = first-x-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = first-z;
q = first-z; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p2++;
p2++; 
 }
} 
 }
} 

 } else
} else  {
{ 
 dis = x-first-1;
dis = x-first-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = x-z;
q = x-z; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p2++;
p2++; 
 }
} 
 }
} 
 }
} 

 if (p2 == dis)
if (p2 == dis)  {
{ 
 p2 = 100;
p2 = 100; 
 }
} 

 if (second>y)
if (second>y)  {
{ 
 dis = second-y-1;
dis = second-y-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = second-z;
q = second-z; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p3++;
p3++; 
 }
} 
 }
} 

 } else
} else  {
{ 
 dis = y-second-1;
dis = y-second-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = y-z;
q = y-z; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p3++;
p3++; 
 }
} 
 }
} 
 }
} 

 if (p3 == dis)
if (p3 == dis)  {
{ 
 p3 = 100;
p3 = 100; 
 }
} 
 p = p1+p2+p3;
p = p1+p2+p3; 

 if (p == 300)
if (p == 300)  {
{ 
 co = math.abs(x-y)/12+math.abs(second-y)+math.abs(first-x);
co = math.abs(x-y)/12+math.abs(second-y)+math.abs(first-x); 
 }
} 
 return (co);
return (co); 
 }
} 

 function jiance_lie2(x, y)
function jiance_lie2(x, y)  {
{ 
 p4 = 0;
p4 = 0; 

 if (x>y)
if (x>y)  {
{ 
 dis = (x-y)/12-1;
dis = (x-y)/12-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = x-z*12;
q = x-z*12; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p4++;
p4++; 
 }
} 
 }
} 

 } else
} else  {
{ 
 dis = (y-x)/12-1;
dis = (y-x)/12-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = y-z*12;
q = y-z*12; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p4++;
p4++; 
 }
} 
 }
} 
 }
} 

 if (p4 == dis)
if (p4 == dis)  {
{ 
 p4 = 100;
p4 = 100; 
 }
} 
 return (p4);
return (p4); 
 }
} 

 function panduan_cuowei()
function panduan_cuowei()  {
{ 
 g = 1000;
g = 1000; 
 gg = 1000;
gg = 1000; 
 br = 0;
br = 0; 
 j = 0;
j = 0; 
 k = 0;
k = 0; 
 line1 = first%12;
line1 = first%12; 
 line2 = second%12;
line2 = second%12; 
 line3 = math.floor(first/12);
line3 = math.floor(first/12); 
 line4 = math.floor(second/12);
line4 = math.floor(second/12); 

 for (i=1; i<=12; i++)
for (i=1; i<=12; i++)  {
{ 
 jilu1[i] = line1+(i-1)*12;
jilu1[i] = line1+(i-1)*12; 
 jilu2[i] = line2+(i-1)*12;
jilu2[i] = line2+(i-1)*12; 
 //HANG
//HANG 
 jilu3[i] = line3*12+i;
jilu3[i] = line3*12+i; 
 jilu4[i] = line4*12+i;
jilu4[i] = line4*12+i; 
 //LIE
//LIE 
 }
} 

 for (i=1; i<=12; i++)
for (i=1; i<=12; i++)  {
{ 

 if (jilu1[i] == first)
if (jilu1[i] == first)  {
{ 

 if (zt[jilu2[i]] == 9)
if (zt[jilu2[i]] == 9)  {
{ 
 w = jiance_cuowei01(jilu2[i]);
w = jiance_cuowei01(jilu2[i]); 

 if (w == 200)
if (w == 200)  {
{ 
 guaixian1_hen1(jilu2[i]);
guaixian1_hen1(jilu2[i]); 
 _root.control.ok();
_root.control.ok(); 
 br = 1;
br = 1; 
 break;
break; 
 }
} 
 }
} 

 } else if (jilu2[i] == second)
} else if (jilu2[i] == second)  {
{ 

 if (zt[jilu1[i]] == 9)
if (zt[jilu1[i]] == 9)  {
{ 
 w = jiance_cuowei02(jilu1[i]);
w = jiance_cuowei02(jilu1[i]); 

 if (w == 200)
if (w == 200)  {
{ 
 guaixian1_hen2(jilu1[i]);
guaixian1_hen2(jilu1[i]); 
 _root.control.ok();
_root.control.ok(); 
 br = 1;
br = 1; 
 break;
break; 
 }
} 
 }
} 
 }
} 

 if (zt[jilu1[i]] == 9 and zt[jilu2[i]] == 9)
if (zt[jilu1[i]] == 9 and zt[jilu2[i]] == 9)  {
{ 
 j = jiance_hen1(jilu1[i], jilu2[i]);
j = jiance_hen1(jilu1[i], jilu2[i]); 
 }
} 

 if (j>0)
if (j>0)  {
{ 

 if (j<g)
if (j<g)  {
{ 
 g = j;
g = j; 
 g1 = jilu1[i];
g1 = jilu1[i]; 
 g2 = jilu2[i];
g2 = jilu2[i]; 
 }
} 
 //_root.control.ok();
//_root.control.ok(); 

 } else
} else  {
{ 

 if (zt[jilu3[i]] == 9 and zt[jilu4[i]] == 9)
if (zt[jilu3[i]] == 9 and zt[jilu4[i]] == 9)  {
{ 
 k = jiance_lie1(jilu3[i], jilu4[i]);
k = jiance_lie1(jilu3[i], jilu4[i]); 
 }
} 

 if (k>0)
if (k>0)  {
{ 

 if (k<gg)
if (k<gg)  {
{ 
 gg = k;
gg = k; 
 g3 = jilu3[i];
g3 = jilu3[i]; 
 g4 = jilu4[i];
g4 = jilu4[i]; 
 }
} 
 }
} 
 }
} 
 }
} 

 if (br == 0)
if (br == 0)  {
{ 

 if (g != 1000)
if (g != 1000)  {
{ 
 guaixian2_hen(g1, g2);
guaixian2_hen(g1, g2); 
 br = 1;
br = 1; 

 } else if (gg != 1000)
} else if (gg != 1000)  {
{ 
 guaixian2_lie(g3, g4);
guaixian2_lie(g3, g4); 
 }
} 
 }
} 
 }
} 

 function jiance_cuowei01(x)
function jiance_cuowei01(x)  {
{ 
 //错位状态1;
//错位状态1; 
 p1 = 0;
p1 = 0; 
 p2 = 0;
p2 = 0; 
 dis = math.abs(x-first)-1;
dis = math.abs(x-first)-1; 

 if (dis == 0)
if (dis == 0)  {
{ 
 p1 = 100;
p1 = 100; 

 } else
} else  {
{ 

 if (x>first)
if (x>first)  {
{ 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = x-z;
q = x-z; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p1++;
p1++; 
 }
} 
 }
} 

 } else
} else  {
{ 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = first-z;
q = first-z; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p1++;
p1++; 
 }
} 
 }
} 
 }
} 

 if (p1 == dis)
if (p1 == dis)  {
{ 
 p1 = 100;
p1 = 100; 
 }
} 
 }
} 
 dis = math.abs((second-x))/12-1;
dis = math.abs((second-x))/12-1; 

 if (dis == 0)
if (dis == 0)  {
{ 
 p2 == 100;
p2 == 100; 

 } else
} else  {
{ 

 if (second>x)
if (second>x)  {
{ 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = second-z*12;
q = second-z*12; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p2++;
p2++; 
 }
} 
 }
} 

 } else
} else  {
{ 
 dis = math.abs(dis);
dis = math.abs(dis); 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = x-z*12;
q = x-z*12; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p2++;
p2++; 
 }
} 
 }
} 
 }
} 
 }
} 

 if (p2 == dis)
if (p2 == dis)  {
{ 
 p2 = 100;
p2 = 100; 
 }
} 
 return (p1+p2);
return (p1+p2); 
 }
} 

 function jiance_cuowei02(x)
function jiance_cuowei02(x)  {
{ 
 //错位状态2;
//错位状态2; 
 p1 = 0;
p1 = 0; 
 p2 = 0;
p2 = 0; 
 dis = math.abs(x-second)-1;
dis = math.abs(x-second)-1; 

 if (dis == 0)
if (dis == 0)  {
{ 
 p1 = 100;
p1 = 100; 

 } else
} else  {
{ 

 if (x>second)
if (x>second)  {
{ 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = x-z;
q = x-z; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p1++;
p1++; 
 }
} 
 }
} 

 } else
} else  {
{ 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = second-z;
q = second-z; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p1++;
p1++; 
 }
} 
 }
} 
 }
} 

 if (p1 == dis)
if (p1 == dis)  {
{ 
 p1 = 100;
p1 = 100; 
 }
} 
 }
} 
 dis = math.abs((first-x))/12-1;
dis = math.abs((first-x))/12-1; 

 if (dis == 0)
if (dis == 0)  {
{ 
 p2 == 100;
p2 == 100; 

 } else
} else  {
{ 

 if (first>x)
if (first>x)  {
{ 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = first-z*12;
q = first-z*12; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p2++;
p2++; 
 }
} 
 }
} 

 } else
} else  {
{ 
 dis = math.abs(dis);
dis = math.abs(dis); 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = x-z*12;
q = x-z*12; 

 if (zt[q] == 9)
if (zt[q] == 9)  {
{ 
 p2++;
p2++; 
 }
} 
 }
} 
 }
} 
 }
} 

 if (p2 == dis)
if (p2 == dis)  {
{ 
 p2 = 100;
p2 = 100; 
 }
} 
 return (p1+p2);
return (p1+p2); 
 }
} 

 function henxiang0(x, y)
function henxiang0(x, y)  {
{ 
 //横线0拐点画线函数;
//横线0拐点画线函数; 
 //tellTarget ("ttt"+y) {
//tellTarget ("ttt"+y) { 
 // gotoAndPlay(10);
// gotoAndPlay(10); 
 //}
//} 

 if (x>y)
if (x>y)  {
{ 
 dis = x-y-1;
dis = x-y-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = x-z;
q = x-z; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(10);
gotoAndPlay(10); 
 }
} 
 }
} 

 } else
} else  {
{ 
 dis = y-x-1;
dis = y-x-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = y-z;
q = y-z; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(10);
gotoAndPlay(10); 
 }
} 
 }
} 
 }
} 
 _root.control.ok();
_root.control.ok(); 
 }
} 

 function shuxian0(x, y)
function shuxian0(x, y)  {
{ 
 //竖线0拐点画线函数;
//竖线0拐点画线函数; 

 if (x>y)
if (x>y)  {
{ 
 dis = (x-y)/12-1;
dis = (x-y)/12-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = x-z*12;
q = x-z*12; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(13);
gotoAndPlay(13); 
 }
} 
 }
} 

 } else
} else  {
{ 
 dis = (y-x)/12-1;
dis = (y-x)/12-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = y-z*12;
q = y-z*12; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(13);
gotoAndPlay(13); 
 }
} 
 }
} 
 }
} 
 _root.control.ok();
_root.control.ok(); 
 }
} 

 function guaixian1_hen1(x)
function guaixian1_hen1(x)  {
{ 

 if (x>first and x<second)
if (x>first and x<second)  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(19);
gotoAndPlay(19); 
 }
} 

 } else if (x>first and x>second)
} else if (x>first and x>second)  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(25);
gotoAndPlay(25); 
 }
} 

 } else if (x<first and x<second)
} else if (x<first and x<second)  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(16);
gotoAndPlay(16); 
 }
} 

 } else
} else  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(22);
gotoAndPlay(22); 
 }
} 
 }
} 
 dis = math.abs(x-first)-1;
dis = math.abs(x-first)-1; 

 if (dis != 0)
if (dis != 0)  {
{ 

 if (x>first)
if (x>first)  {
{ 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = x-z;
q = x-z; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(10);
gotoAndPlay(10); 
 }
} 
 }
} 

 } else
} else  {
{ 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = first-z;
q = first-z; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(10);
gotoAndPlay(10); 
 }
} 
 }
} 
 }
} 
 }
} 
 dis = math.abs((second-x))/12-1;
dis = math.abs((second-x))/12-1; 

 if (dis != 0)
if (dis != 0)  {
{ 

 if (second>x)
if (second>x)  {
{ 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = second-z*12;
q = second-z*12; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(13);
gotoAndPlay(13); 
 }
} 
 }
} 

 } else
} else  {
{ 
 dis = math.abs(dis);
dis = math.abs(dis); 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = x-z*12;
q = x-z*12; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(13);
gotoAndPlay(13); 
 }
} 
 }
} 
 }
} 
 }
} 
 }
} 

 function guaixian1_hen2(x)
function guaixian1_hen2(x)  {
{ 

 if (x>first and x<second)
if (x>first and x<second)  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(22);
gotoAndPlay(22); 
 }
} 

 } else if (x>first and x>second)
} else if (x>first and x>second)  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(25);
gotoAndPlay(25); 
 }
} 

 } else if (x<first and x<second)
} else if (x<first and x<second)  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(16);
gotoAndPlay(16); 
 }
} 

 } else
} else  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(19);
gotoAndPlay(19); 
 }
} 
 }
} 
 dis = math.abs(x-second)-1;
dis = math.abs(x-second)-1; 

 if (dis != 0)
if (dis != 0)  {
{ 

 if (x>second)
if (x>second)  {
{ 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = x-z;
q = x-z; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(10);
gotoAndPlay(10); 
 }
} 
 }
} 

 } else
} else  {
{ 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = second-z;
q = second-z; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(10);
gotoAndPlay(10); 
 }
} 
 }
} 
 }
} 
 }
} 
 dis = math.abs((first-x))/12-1;
dis = math.abs((first-x))/12-1; 

 if (dis != 0)
if (dis != 0)  {
{ 

 if (first>x)
if (first>x)  {
{ 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = first-z*12;
q = first-z*12; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(13);
gotoAndPlay(13); 
 }
} 
 }
} 

 } else
} else  {
{ 
 dis = math.abs(dis);
dis = math.abs(dis); 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = x-z*12;
q = x-z*12; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(13);
gotoAndPlay(13); 
 }
} 
 }
} 
 }
} 
 }
} 
 }
} 

 function guaixian2_hen(x, y)
function guaixian2_hen(x, y)  {
{ 

 if (x<first and y<second and x<y)
if (x<first and y<second and x<y)  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(16);
gotoAndPlay(16); 
 }
} 

 tellTarget ("ttt"+y)
tellTarget ("ttt"+y)  {
{ 
 gotoAndPlay(19);
gotoAndPlay(19); 
 }
} 

 } else if (x<first and y<second and x>y)
} else if (x<first and y<second and x>y)  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(19);
gotoAndPlay(19); 
 }
} 

 tellTarget ("ttt"+y)
tellTarget ("ttt"+y)  {
{ 
 gotoAndPlay(16);
gotoAndPlay(16); 
 }
} 

 } else if (x>first and y>second and x<y)
} else if (x>first and y>second and x<y)  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(22);
gotoAndPlay(22); 
 }
} 

 tellTarget ("ttt"+y)
tellTarget ("ttt"+y)  {
{ 
 gotoAndPlay(25);
gotoAndPlay(25); 
 }
} 

 } else if (x>first and y>second and x>y)
} else if (x>first and y>second and x>y)  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(25);
gotoAndPlay(25); 
 }
} 

 tellTarget ("ttt"+y)
tellTarget ("ttt"+y)  {
{ 
 gotoAndPlay(22);
gotoAndPlay(22); 
 }
} 

 } else if (x>first and y<second and x<y)
} else if (x>first and y<second and x<y)  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(22);
gotoAndPlay(22); 
 }
} 

 tellTarget ("ttt"+y)
tellTarget ("ttt"+y)  {
{ 
 gotoAndPlay(19);
gotoAndPlay(19); 
 }
} 

 } else if (x>first and y<second and x>y)
} else if (x>first and y<second and x>y)  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(25);
gotoAndPlay(25); 
 }
} 

 tellTarget ("ttt"+y)
tellTarget ("ttt"+y)  {
{ 
 gotoAndPlay(16);
gotoAndPlay(16); 
 }
} 

 } else if (x<first and y>second and x<y)
} else if (x<first and y>second and x<y)  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(16);
gotoAndPlay(16); 
 }
} 

 tellTarget ("ttt"+y)
tellTarget ("ttt"+y)  {
{ 
 gotoAndPlay(25);
gotoAndPlay(25); 
 }
} 

 } else
} else  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(19);
gotoAndPlay(19); 
 }
} 

 tellTarget ("ttt"+y)
tellTarget ("ttt"+y)  {
{ 
 gotoAndPlay(22);
gotoAndPlay(22); 
 }
} 
 }
} 

 if (x>y)
if (x>y)  {
{ 
 dis = x-y-1;
dis = x-y-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = x-z;
q = x-z; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(10);
gotoAndPlay(10); 
 }
} 
 }
} 

 } else
} else  {
{ 
 dis = y-x-1;
dis = y-x-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = y-z;
q = y-z; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(10);
gotoAndPlay(10); 
 }
} 
 }
} 
 }
} 

 if (first>x)
if (first>x)  {
{ 
 dis = (first-x)/12-1;
dis = (first-x)/12-1; 

 if (dis != 0)
if (dis != 0)  {
{ 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = first-z*12;
q = first-z*12; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(13);
gotoAndPlay(13); 
 }
} 
 }
} 
 }
} 

 } else
} else  {
{ 
 dis = (x-first)/12-1;
dis = (x-first)/12-1; 

 if (dis != 0)
if (dis != 0)  {
{ 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = x-z*12;
q = x-z*12; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(13);
gotoAndPlay(13); 
 }
} 
 }
} 
 }
} 
 }
} 

 if (second>y)
if (second>y)  {
{ 
 dis = (second-y)/12-1;
dis = (second-y)/12-1; 

 if (dis != 0)
if (dis != 0)  {
{ 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = second-z*12;
q = second-z*12; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(13);
gotoAndPlay(13); 
 }
} 
 }
} 
 }
} 

 } else
} else  {
{ 
 dis = (y-second)/12-1;
dis = (y-second)/12-1; 

 if (dis != 0)
if (dis != 0)  {
{ 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = y-z*12;
q = y-z*12; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(13);
gotoAndPlay(13); 
 }
} 
 }
} 
 }
} 
 }
} 
 _root.control.ok();
_root.control.ok(); 
 }
} 

 function guaixian2_lie(x, y)
function guaixian2_lie(x, y)  {
{ 

 if (x<first and y<second and x<y)
if (x<first and y<second and x<y)  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(16);
gotoAndPlay(16); 
 }
} 

 tellTarget ("ttt"+y)
tellTarget ("ttt"+y)  {
{ 
 gotoAndPlay(22);
gotoAndPlay(22); 
 }
} 

 } else if (x<first and y<second and x>y)
} else if (x<first and y<second and x>y)  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(22);
gotoAndPlay(22); 
 }
} 

 tellTarget ("ttt"+y)
tellTarget ("ttt"+y)  {
{ 
 gotoAndPlay(16);
gotoAndPlay(16); 
 }
} 

 } else if (x>first and y>second and x<y)
} else if (x>first and y>second and x<y)  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(19);
gotoAndPlay(19); 
 }
} 

 tellTarget ("ttt"+y)
tellTarget ("ttt"+y)  {
{ 
 gotoAndPlay(25);
gotoAndPlay(25); 
 }
} 

 } else if (x>first and y>second and x>y)
} else if (x>first and y>second and x>y)  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(25);
gotoAndPlay(25); 
 }
} 

 tellTarget ("ttt"+y)
tellTarget ("ttt"+y)  {
{ 
 gotoAndPlay(19);
gotoAndPlay(19); 
 }
} 

 } else if (x>first and y<second and x>y)
} else if (x>first and y<second and x>y)  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(25);
gotoAndPlay(25); 
 }
} 

 tellTarget ("ttt"+y)
tellTarget ("ttt"+y)  {
{ 
 gotoAndPlay(16);
gotoAndPlay(16); 
 }
} 

 } else if (x>first and y<second and x<y)
} else if (x>first and y<second and x<y)  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(19);
gotoAndPlay(19); 
 }
} 

 tellTarget ("ttt"+y)
tellTarget ("ttt"+y)  {
{ 
 gotoAndPlay(22);
gotoAndPlay(22); 
 }
} 

 } else if (x<first and y>second and x<y)
} else if (x<first and y>second and x<y)  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(16);
gotoAndPlay(16); 
 }
} 

 tellTarget ("ttt"+y)
tellTarget ("ttt"+y)  {
{ 
 gotoAndPlay(25);
gotoAndPlay(25); 
 }
} 

 } else
} else  {
{ 

 tellTarget ("ttt"+x)
tellTarget ("ttt"+x)  {
{ 
 gotoAndPlay(22);
gotoAndPlay(22); 
 }
} 

 tellTarget ("ttt"+y)
tellTarget ("ttt"+y)  {
{ 
 gotoAndPlay(19);
gotoAndPlay(19); 
 }
} 
 }
} 

 if (x>y)
if (x>y)  {
{ 
 dis = (x-y)/12-1;
dis = (x-y)/12-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = x-z*12;
q = x-z*12; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(13);
gotoAndPlay(13); 
 }
} 
 }
} 

 } else
} else  {
{ 
 dis = (y-x)/12-1;
dis = (y-x)/12-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = y-z*12;
q = y-z*12; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(13);
gotoAndPlay(13); 
 }
} 
 }
} 
 }
} 

 if (first>x)
if (first>x)  {
{ 
 dis = first-x-1;
dis = first-x-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = first-z;
q = first-z; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(10);
gotoAndPlay(10); 
 }
} 
 }
} 

 } else
} else  {
{ 
 dis = x-first-1;
dis = x-first-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = x-z;
q = x-z; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(10);
gotoAndPlay(10); 
 }
} 
 }
} 
 }
} 

 if (second>y)
if (second>y)  {
{ 
 dis = second-y-1;
dis = second-y-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = second-z;
q = second-z; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(10);
gotoAndPlay(10); 
 }
} 
 }
} 

 } else
} else  {
{ 
 dis = y-second-1;
dis = y-second-1; 

 for (z=1; z<=dis; z++)
for (z=1; z<=dis; z++)  {
{ 
 q = y-z;
q = y-z; 

 tellTarget ("ttt"+q)
tellTarget ("ttt"+q)  {
{ 
 gotoAndPlay(10);
gotoAndPlay(10); 
 }
} 
 }
} 
 }
} 
 _root.control.ok();
_root.control.ok(); 
 }
} 

 function selectframe(number)
function selectframe(number)  {
{ 

 switch (number)
switch (number)  {
{ 
 case 1 :
case 1 : 

 tellTarget ("ttt"+i)
tellTarget ("ttt"+i)  {
{ 
 gotoAndStop(1);
gotoAndStop(1); 
 }
} 
 break;
break; 
 case 2 :
case 2 : 

 tellTarget ("ttt"+i)
tellTarget ("ttt"+i)  {
{ 
 gotoAndStop(2);
gotoAndStop(2); 
 }
} 
 break;
break; 
 case 3 :
case 3 : 

 tellTarget ("ttt"+i)
tellTarget ("ttt"+i)  {
{ 
 gotoAndStop(3);
gotoAndStop(3); 
 }
} 
 break;
break; 
 case 4 :
case 4 : 

 tellTarget ("ttt"+i)
tellTarget ("ttt"+i)  {
{ 
 gotoAndStop(4);
gotoAndStop(4); 
 }
} 
 break;
break; 
 case 5 :
case 5 : 

 tellTarget ("ttt"+i)
tellTarget ("ttt"+i)  {
{ 
 gotoAndStop(5);
gotoAndStop(5); 
 }
} 
 break;
break; 
 case 6 :
case 6 : 

 tellTarget ("ttt"+i)
tellTarget ("ttt"+i)  {
{ 
 gotoAndStop(6);
gotoAndStop(6); 
 }
} 
 break;
break; 
 case 7 :
case 7 : 

 tellTarget ("ttt"+i)
tellTarget ("ttt"+i)  {
{ 
 gotoAndStop(7);
gotoAndStop(7); 
 }
} 
 break;
break; 
 case 8 :
case 8 : 

 tellTarget ("ttt"+i)
tellTarget ("ttt"+i)  {
{ 
 gotoAndStop(8);
gotoAndStop(8); 
 }
} 
 break;
break; 
 case 9 :
case 9 : 

 tellTarget ("ttt"+i)
tellTarget ("ttt"+i)  {
{ 
 gotoAndStop(28);
gotoAndStop(28); 
 }
} 
 break;
break; 
 case 10 :
case 10 : 

 tellTarget ("ttt"+i)
tellTarget ("ttt"+i)  {
{ 
 gotoAndStop(29);
gotoAndStop(29); 
 }
} 
 break;
break; 
 }
} 
 }
} 

 function ok()
function ok()  {
{ 
 //可消除的处理函数;
//可消除的处理函数; 

 tellTarget ("ttt"+first)
tellTarget ("ttt"+first)  {
{ 
 gotoAndStop(9);
gotoAndStop(9); 
 }
} 
 zt[first] = 9;
zt[first] = 9; 

 tellTarget ("ttt"+second)
tellTarget ("ttt"+second)  {
{ 
 gotoAndStop(9);
gotoAndStop(9); 
 }
} 
 zt[second] = 9;
zt[second] = 9; 
 c = zt[second];
c = zt[second]; 
 }
} 
 }
} 
 //julu数组为待检测点,ZT数组为各点状态;
//julu数组为待检测点,ZT数组为各点状态; 
 //9:消除;10:横线;13:竖线;16:「;19:7;22:L;25:」;
//9:消除;10:横线;13:竖线;16:「;19:7;22:L;25:」; 

 基本思路就是分两种情况考虑寻道算法,
基本思路就是分两种情况考虑寻道算法, 

 为每一个小牌取个名字,(我用程序生成,并用数组记录下每个牌的状态,是无牌状态还是有牌状态)
为每一个小牌取个名字,(我用程序生成,并用数组记录下每个牌的状态,是无牌状态还是有牌状态) 

 一是在同行同列上
一是在同行同列上 

 只要判断从起点到终点的所有牌的状态是否都为无牌状态,也就是起点牌到终点牌是否是连通的
只要判断从起点到终点的所有牌的状态是否都为无牌状态,也就是起点牌到终点牌是否是连通的 

 二是只有一个拐点
二是只有一个拐点 

 先检测它们的所在行列所在的交汇点,判断他们的交绘点是否为无牌状态,如果是则继续判断从该交绘点分别到起点和终点间是否为连通,这时的方法同第一种方法一样.
先检测它们的所在行列所在的交汇点,判断他们的交绘点是否为无牌状态,如果是则继续判断从该交绘点分别到起点和终点间是否为连通,这时的方法同第一种方法一样. 

 三是有两个拐点
三是有两个拐点 

 同样先判断这两个点所在行和列的两个交汇点,先判断两个交汇点间是否为空,若是则继续判断两个交汇点到起点终点是否为连通,这两中判断也可以分解为是第一种状态来进行判断
同样先判断这两个点所在行和列的两个交汇点,先判断两个交汇点间是否为空,若是则继续判断两个交汇点到起点终点是否为连通,这两中判断也可以分解为是第一种状态来进行判断 

