+4 do
if (j>=0) and (j<=15) then
begin
if FiveChess_array[X,j].state=state then
begin
Inc(Count) ;
if count=5 then begin
result:=true;
break;
end;
end
else
Count:=0;
end;
//判断''\''方向
count:=0;
For k:=-4 to 4 do begin
i:=X+k;
j:=Y+k;
if (j>=0) and (j<=15) And(i>=0) and(i<=15) then
begin
if FiveChess_array[i,j].state=state then
begin
Inc(Count) ;
if count=5 then begin
result:=true;
break;
end;
end
else
Count:=0;
end;
end;
//判断''/''方向
count:=0;
For k:=-4 to 4 do begin
i:=X+k;
j:=Y-k;
if (j>=0) and (j<=15) And(i>=0) and(i<=15) then
begin
if FiveChess_array[i,j].state=state then
begin
Inc(Count) ;
if count=5 then begin
result:=true;
break;
end;
end
else
Count:=0;
end;
end;
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
begin
Application.Terminate ;
end;
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
Start_Flag:=true;
If Start_Flag then begin
Form1.Image2.Enabled := true;
Form1.Timer1.Enabled := true;
Ini_Main;
end;
end;
function Draw_Qizi_White(X,Y : Integer):boolean;
var
i,j,x1,x2,y1,y2 : integer;
begin
result := false;
for i:=0 to 14 do
For j:=0 to 14 do begin
if (X> FiveChess_Array[i,j].x1)and(X<FiveChess_Array[i,j].x2)
and (y> FiveChess_Array[i,j].y1)and(y<FiveChess_Array[i,j].y2)
and (FiveChess_Array[i,j].state=0) then
begin
if FiveChess_Array[Undo_i,Undo_j].state<>0 then begin
Form1.Image2.Canvas.Brush.Color:=Rgb(100,100,100);
Form1.Image2.Canvas.FillRect (Rect(px1,py1,px2,py2));
end;
Form1.Image2.Canvas.Brush.Color:=Rgb(255,255,255);
Form1.Image2.Canvas.Ellipse ( FiveChess_Array[i,j].x1,
FiveChess_Array[i,j].y1,FiveChess_Array[i,j].x2,FiveChess_Array[i,j].y2);
Form1.Image2.Canvas.Brush.Color:=RGB(255,255,255);