Курсовая работа: Разработка алгоритма и реализация игры "Реверси"
if (i<7) and (j>0) and (brd[i+1, j-1]=0) then intern:= FALSE;
if (i<7) and (brd[i+1, j]=0) then intern:= FALSE;
if (i<7) and (j<7) and (brd[i+1, j+1]=0) then intern:= FALSE;
if (j>0) and (brd[i, j-1]=0) then intern:= FALSE;
if (j<7) and (brd[i, j+1]=0) then intern:= FALSE;
if intern then inc(data.internal);
end;
result:=data;
end;
function CheckMove(color:byte; cx, cy: integer): integer;
// Function check: is move to (cx, cy) possible?
// Parameter: color - Who makes the move, black or white?
// if (colour == 0) White do a move
// if (colour == 1) Black do a move
// return: 0 - if impossible
// 1 - if possible, and number
// value is amount of the seized disks
var test, passed: boolean;
i, j, total: integer;
wc1, wc2: byte; // What to check
begin
total:=0;
// do a copy of board
for i:=0 to 7 do
for j:=0 to 7 do
brd2[i, j]:= brd[i, j];
if color=0 then //white
begin
wc1:= 2;