82
Mat[txy[i].M,Txy[i].N].Sum:=Mat[xy.M,xy.N].Sum+1;
Mat[txy[i].M,Txy[i].N].Status:=3;
PushRight(Top,Txy[i],Ok);
gotoxy(txy[i].M+1,Txy[i].N+1);
textcolor(blue);
write(chr(1));
End;
End;
For i:=1 to 4 do Txy1[i]:=Txy[i];
txy1[5]:=Txy1[1];
for i:=1 to 4 do
if (Txy[i+4].N>=0) and (Txy[i+4].M>=0) then
Begin
flag:=1;
for i1:=1 to K do
Begin
if (Txy1[i+1].N>-1) and
(Txy1[i].M>-1) and
(Mat1[i1,txy1[i].M,Txy1[i].N]=Mat1[i1,txy1[i+1].M,Txy1[i+1].N]) and
(Mat1[i1,txy1[i].M,Txy1[i].N]>0) then Flag:=0;
End;
if (Mat[txy[i+4].M,Txy[i+4].N].Status=0) and (Flag=1) then
Begin
Mat[Txy[i+4].M,Txy[i+4].N].Mo:=Xy.M;
Mat[Txy[i+4].M,Txy[i+4].N].No:=Xy.N;
Mat[txy[i+4].M,Txy[i+4].N].Sum:=Mat[xy.M,xy.N].Sum+1;
Mat[txy[i+4].M,Txy[i+4].N].Status:=3;
PushRight(Top,Txy[i+4],Ok);
textcolor(red);
gotoxy(txy[i+4].M+1,Txy[i+4].N+1);
write(chr(1));
End;
End;
PopLeft(top,Xy,Ok);
if Ok=true then goto Start;
End;
Procedure BacKTrace;
Var
i,j:Integer;
SumF:Integer;
Flag:Integer;
Back,Back1:TypeInfo;
Top:TypeTop;
Txy:typeTxy;
ok:Boolean;
Name:String;
F:text;
Procedure TestHod( xy : TypeInfo;
var Txy:typeTxy);