pan();
var
i,j : integer;
begin
Form1.Image2.Canvas.Brush.Color:=RGB(247,207,16);
Form1.Image2.Canvas.FillRect(Rect(0,0,400,400));
Form1.Image2.Canvas.pen.Color:=RGB(0,0,0);
for i:=1 to 16 do begin
Form1.Image2.Canvas.MoveTo(0,25*i);
Form1.Image2.Canvas.LineTo (400,25*i);
Form1.Image2.Canvas.MoveTo(25*i,0);
Form1.Image2.Canvas.LineTo (25*i,400);
end;
end;
procedure Undo_Run();
var
x1,x2,y1,y2 : integer;
begin
if (Undo_i<>-1) and (Undo_j<>-1) then begin
FiveChess_array[Undo_i,Undo_j].state :=0;
x1:= FiveChess_Array[Undo_i,Undo_j].x1-2;
y1:= FiveChess_Array[Undo_i,Undo_j].y1-2;
x2:= FiveChess_Array[Undo_i,Undo_j].x2+2;
y2:= FiveChess_Array[Undo_i,Undo_j].y2+2;
Form1.Image2.Canvas.Brush.Color:=RGB(247,207,16);
Form1.Image2.Canvas.FillRect(rect(x1,y1,x2,y2));
Form1.Image2.Canvas.pen.Color:=RGB(0,0,0);
Form1.Image2.Canvas.MoveTo((x1+x2)div 2-1 , y1);
Form1.Image2.Canvas.LineTo((x1+x2)div 2-1 , y2);
Form1.Image2.Canvas.MoveTo(x1,(y1+y2)div 2-1);
Form1.Image2.Canvas.LineTo(x2,(y1+y2)div 2-1);
end;
If Online=black then
Online:=White
else
Online:=Black;
end;
function Ini_Main():Boolean ;
begin
Result:=true;
px1:=0;
px2:=0;
py1:=0;
py2:=0;
Undo_i:=-1;
Undo_j:=-1;
whitetime:=0;
blacktime:=0;
form1.Label9.Caption :=inttostr(whitewin);
form1.Label10.Caption :=inttostr(blackwin);
Ini_FiveChess_Array;
Draw_Qipan;
end;
Function Judge_Success_on_off (X,Y,State:integer):Boolean;
var
i,j,k,count : integer;
begin
Count:=0;
Result:=false;
// 判断竖列
For i:=X-4 to X+4 do
if (i>=0) and (i<=15) then
begin
if FiveChess_array[i,y].state=state then
begin
Inc(Count) ;
if count=5 then begin
result:=true;
break;
end;
end
else
Count:=0;
end;
//判断横行
count:=0;
For j:=y-4 to y