function [finish]=Check_Constraint(Lnum,Level,CheckPoint)
lengthy=5+floor((Lnum-1)/9);
finish=1;
for ii=1:lengthy
for jj=1:lengthy
if CheckPoint(1,1)+1<=lengthy,
if Level(Lnum).Box(CheckPoint(1,1)+1,CheckPoint(1,2))==0, finish=0; end
end
if CheckPoint(1,1)-1>0,
if Level(Lnum).Box(CheckPoint(1,1)-1,CheckPoint(1,2))==0, finish=0; end
end
if CheckPoint(1,2)+1<=lengthy,
if Level(Lnum).Box(CheckPoint(1,1),CheckPoint(1,2)+1)==0, finish=0; end
end
if CheckPoint(1,2)-1>0,
if Level(Lnum).Box(CheckPoint(1,1),CheckPoint(1,2)-1)==0, finish=0; end
end
end
end