⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ueval.pas

📁 象棋源码
💻 PAS
📖 第 1 页 / 共 5 页
字号:
    begin
        changechess(i,1,mancolor,0);
        if chessable=0 then inc(addition,freehand);
    end
        else
    begin
        changechess(i,1,mancolor,0);
        if chessable=1 then dec(addition,freehand);
    end;
end;
for i:=2 to 7 do
if ichess[i,8]=none then
begin
    changechess(i,8,compcolor,0);
    if chessable=1 then
    begin
        changechess(i,8,mancolor,0);
        if chessable=0 then inc(addition,freehand);
    end
        else
    begin
        changechess(i,8,mancolor,0);
        if chessable=1 then dec(addition,freehand);
    end;
end; }

//---o
//--oo
  if (ichess[4, 1] = mancolor) and (ichess[4, 2] = mancolor) and (ichess[3, 2] = mancolor) and (ichess[3, 1] = none) and (ichess[2, 1] = none) and (ichess[1, 1] = none) then
    inc(addition, freehand);
  if (ichess[5, 1] = mancolor) and (ichess[5, 2] = mancolor) and (ichess[6, 2] = mancolor) and (ichess[6, 1] = none) and (ichess[7, 1] = none) and (ichess[8, 1] = none) then
    inc(addition, freehand);
  if (ichess[1, 4] = mancolor) and (ichess[2, 4] = mancolor) and (ichess[2, 3] = mancolor) and (ichess[1, 3] = none) and (ichess[1, 2] = none) and (ichess[1, 1] = none) then
    inc(addition, freehand);
  if (ichess[1, 5] = mancolor) and (ichess[2, 5] = mancolor) and (ichess[2, 6] = mancolor) and (ichess[1, 6] = none) and (ichess[1, 7] = none) and (ichess[1, 8] = none) then
    inc(addition, freehand);
  if (ichess[4, 8] = mancolor) and (ichess[4, 7] = mancolor) and (ichess[3, 7] = mancolor) and (ichess[3, 8] = none) and (ichess[2, 8] = none) and (ichess[1, 8] = none) then
    inc(addition, freehand);
  if (ichess[5, 8] = mancolor) and (ichess[5, 7] = mancolor) and (ichess[6, 7] = mancolor) and (ichess[6, 8] = none) and (ichess[7, 8] = none) and (ichess[8, 8] = none) then
    inc(addition, freehand);
  if (ichess[8, 4] = mancolor) and (ichess[7, 4] = mancolor) and (ichess[7, 3] = mancolor) and (ichess[8, 3] = none) and (ichess[8, 2] = none) and (ichess[8, 1] = none) then
    inc(addition, freehand);
  if (ichess[8, 5] = mancolor) and (ichess[7, 5] = mancolor) and (ichess[7, 6] = mancolor) and (ichess[8, 6] = none) and (ichess[8, 7] = none) and (ichess[8, 8] = none) then
    inc(addition, freehand);

  if (ichess[4, 1] = compcolor) and (ichess[4, 2] = compcolor) and (ichess[3, 2] = compcolor) and (ichess[3, 1] = none) and (ichess[2, 1] = none) and (ichess[1, 1] = none) then
    dec(addition, freehand);
  if (ichess[5, 1] = compcolor) and (ichess[5, 2] = compcolor) and (ichess[6, 2] = compcolor) and (ichess[6, 1] = none) and (ichess[7, 1] = none) and (ichess[8, 1] = none) then
    dec(addition, freehand);
  if (ichess[1, 4] = compcolor) and (ichess[2, 4] = compcolor) and (ichess[2, 3] = compcolor) and (ichess[1, 3] = none) and (ichess[1, 2] = none) and (ichess[1, 1] = none) then
    dec(addition, freehand);
  if (ichess[1, 5] = compcolor) and (ichess[2, 5] = compcolor) and (ichess[2, 6] = compcolor) and (ichess[1, 6] = none) and (ichess[1, 7] = none) and (ichess[1, 8] = none) then
    dec(addition, freehand);
  if (ichess[4, 8] = compcolor) and (ichess[4, 7] = compcolor) and (ichess[3, 7] = compcolor) and (ichess[3, 8] = none) and (ichess[2, 8] = none) and (ichess[1, 8] = none) then
    dec(addition, freehand);
  if (ichess[5, 8] = compcolor) and (ichess[5, 7] = compcolor) and (ichess[6, 7] = compcolor) and (ichess[6, 8] = none) and (ichess[7, 8] = none) and (ichess[8, 8] = none) then
    dec(addition, freehand);
  if (ichess[8, 4] = compcolor) and (ichess[7, 4] = compcolor) and (ichess[7, 3] = compcolor) and (ichess[8, 3] = none) and (ichess[8, 2] = none) and (ichess[8, 1] = none) then
    dec(addition, freehand);
  if (ichess[8, 5] = compcolor) and (ichess[7, 5] = compcolor) and (ichess[7, 6] = compcolor) and (ichess[8, 6] = none) and (ichess[8, 7] = none) and (ichess[8, 8] = none) then
    dec(addition, freehand);
{//-??????-
//--oooo--
if (ichess[3,2]=mancolor)and(ichess[4,2]=mancolor)and(ichess[5,2]=mancolor)and(ichess[6,2]=mancolor)and(ichess[7,2]=none)and(ichess[2,2]=none)and(ichess[8,1]=none)and(ichess[1,1]=none)then
    inc(addition,freehand);
if (ichess[3,7]=mancolor)and(ichess[4,7]=mancolor)and(ichess[5,7]=mancolor)and(ichess[6,7]=mancolor)and(ichess[7,7]=none)and(ichess[2,7]=none)and(ichess[8,8]=none)and(ichess[1,8]=none)then
    inc(addition,freehand);
if (ichess[2,3]=mancolor)and(ichess[2,4]=mancolor)and(ichess[2,5]=mancolor)and(ichess[2,6]=mancolor)and(ichess[2,7]=none)and(ichess[2,2]=none)and(ichess[1,8]=none)and(ichess[1,1]=none)then
    inc(addition,freehand);
if (ichess[7,3]=mancolor)and(ichess[7,4]=mancolor)and(ichess[7,5]=mancolor)and(ichess[7,6]=mancolor)and(ichess[7,7]=none)and(ichess[7,2]=none)and(ichess[8,8]=none)and(ichess[8,1]=none)then
    inc(addition,freehand);
if (ichess[3,2]=compcolor)and(ichess[4,2]=compcolor)and(ichess[5,2]=compcolor)and(ichess[6,2]=compcolor)and(ichess[7,2]=none)and(ichess[2,2]=none)and(ichess[8,1]=none)and(ichess[1,1]=none)then
    dec(addition,freehand);
if (ichess[3,7]=compcolor)and(ichess[4,7]=compcolor)and(ichess[5,7]=compcolor)and(ichess[6,7]=compcolor)and(ichess[7,7]=none)and(ichess[2,7]=none)and(ichess[8,8]=none)and(ichess[1,8]=none)then
    dec(addition,freehand);
if (ichess[2,3]=compcolor)and(ichess[2,4]=compcolor)and(ichess[2,5]=compcolor)and(ichess[2,6]=compcolor)and(ichess[2,7]=none)and(ichess[2,2]=none)and(ichess[1,8]=none)and(ichess[1,1]=none)then
    dec(addition,freehand);
if (ichess[7,3]=compcolor)and(ichess[7,4]=compcolor)and(ichess[7,5]=compcolor)and(ichess[7,6]=compcolor)and(ichess[7,7]=none)and(ichess[7,2]=none)and(ichess[8,8]=none)and(ichess[8,1]=none)then
    dec(addition,freehand);
}
//--o
//?-x
  if (ichess[1, 1] = none) and (ichess[2, 1] = none) and (ichess[3, 1] = compcolor) and (ichess[2, 2] = none) and (ichess[3, 2] = mancolor) then
    inc(addition, freehand);
  if (ichess[8, 1] = none) and (ichess[7, 1] = none) and (ichess[6, 1] = compcolor) and (ichess[7, 2] = none) and (ichess[6, 2] = mancolor) then
    inc(addition, freehand);
  if (ichess[1, 1] = none) and (ichess[1, 2] = none) and (ichess[1, 3] = compcolor) and (ichess[2, 2] = none) and (ichess[2, 3] = mancolor) then
    inc(addition, freehand);
  if (ichess[1, 8] = none) and (ichess[1, 7] = none) and (ichess[1, 6] = compcolor) and (ichess[2, 7] = none) and (ichess[2, 6] = mancolor) then
    inc(addition, freehand);
  if (ichess[1, 8] = none) and (ichess[2, 8] = none) and (ichess[3, 8] = compcolor) and (ichess[2, 7] = none) and (ichess[3, 7] = mancolor) then
    inc(addition, freehand);
  if (ichess[8, 8] = none) and (ichess[7, 8] = none) and (ichess[6, 8] = compcolor) and (ichess[7, 7] = none) and (ichess[6, 7] = mancolor) then
    inc(addition, freehand);
  if (ichess[8, 1] = none) and (ichess[8, 2] = none) and (ichess[8, 3] = compcolor) and (ichess[7, 2] = none) and (ichess[7, 3] = mancolor) then
    inc(addition, freehand);
  if (ichess[8, 8] = none) and (ichess[8, 7] = none) and (ichess[8, 6] = compcolor) and (ichess[7, 7] = none) and (ichess[7, 6] = mancolor) then
    inc(addition, freehand);

  if (ichess[1, 1] = none) and (ichess[2, 1] = none) and (ichess[3, 1] = mancolor) and (ichess[2, 2] = none) and (ichess[3, 2] = compcolor) then
    dec(addition, freehand);
  if (ichess[8, 1] = none) and (ichess[7, 1] = none) and (ichess[6, 1] = mancolor) and (ichess[7, 2] = none) and (ichess[6, 2] = compcolor) then
    dec(addition, freehand);
  if (ichess[1, 1] = none) and (ichess[1, 2] = none) and (ichess[1, 3] = mancolor) and (ichess[2, 2] = none) and (ichess[2, 3] = compcolor) then
    dec(addition, freehand);
  if (ichess[1, 8] = none) and (ichess[1, 7] = none) and (ichess[1, 6] = mancolor) and (ichess[2, 7] = none) and (ichess[2, 6] = compcolor) then
    dec(addition, freehand);
  if (ichess[1, 8] = none) and (ichess[2, 8] = none) and (ichess[3, 8] = mancolor) and (ichess[2, 7] = none) and (ichess[3, 7] = compcolor) then
    dec(addition, freehand);
  if (ichess[8, 8] = none) and (ichess[7, 8] = none) and (ichess[6, 8] = mancolor) and (ichess[7, 7] = none) and (ichess[6, 7] = compcolor) then
    dec(addition, freehand);
  if (ichess[8, 1] = none) and (ichess[8, 2] = none) and (ichess[8, 3] = mancolor) and (ichess[7, 2] = none) and (ichess[7, 3] = compcolor) then
    dec(addition, freehand);
  if (ichess[8, 8] = none) and (ichess[8, 7] = none) and (ichess[8, 6] = mancolor) and (ichess[7, 7] = none) and (ichess[7, 6] = compcolor) then
    dec(addition, freehand);

//??oo-o??
//??oooo??
{if (ichess[3,1]=compcolor)and(ichess[4,1]=compcolor)and(ichess[5,1]=none)and(ichess[6,1]=compcolor)and(ichess[3,2]=compcolor)and(ichess[4,2]=compcolor)and(ichess[5,2]=compcolor)and(ichess[6,2]=compcolor)then
    dec(addition,freehand);
if (ichess[3,1]=compcolor)and(ichess[4,1]=none)and(ichess[5,1]=compcolor)and(ichess[6,1]=compcolor)and(ichess[3,2]=compcolor)and(ichess[4,2]=compcolor)and(ichess[5,2]=compcolor)and(ichess[6,2]=compcolor)then
    dec(addition,freehand);
if (ichess[1,3]=compcolor)and(ichess[1,4]=compcolor)and(ichess[1,5]=none)and(ichess[1,6]=compcolor)and(ichess[2,3]=compcolor)and(ichess[2,4]=compcolor)and(ichess[2,5]=compcolor)and(ichess[2,6]=compcolor)then
    dec(addition,freehand);
if (ichess[1,3]=compcolor)and(ichess[1,4]=compcolor)and(ichess[1,5]=compcolor)and(ichess[1,6]=none)and(ichess[2,3]=compcolor)and(ichess[2,4]=compcolor)and(ichess[2,5]=compcolor)and(ichess[2,6]=compcolor)then
    dec(addition,freehand);
if (ichess[3,8]=compcolor)and(ichess[4,8]=compcolor)and(ichess[5,8]=none)and(ichess[6,8]=compcolor)and(ichess[3,7]=compcolor)and(ichess[4,7]=compcolor)and(ichess[5,7]=compcolor)and(ichess[6,7]=compcolor)then
    dec(addition,freehand);
if (ichess[3,8]=compcolor)and(ichess[4,8]=none)and(ichess[5,8]=compcolor)and(ichess[6,8]=compcolor)and(ichess[3,7]=compcolor)and(ichess[4,7]=compcolor)and(ichess[5,7]=compcolor)and(ichess[6,7]=compcolor)then
    dec(addition,freehand);
if (ichess[8,3]=compcolor)and(ichess[8,4]=compcolor)and(ichess[8,5]=none)and(ichess[8,6]=compcolor)and(ichess[7,3]=compcolor)and(ichess[7,4]=compcolor)and(ichess[7,5]=compcolor)and(ichess[7,6]=compcolor)then
    dec(addition,freehand);
if (ichess[8,3]=compcolor)and(ichess[8,4]=compcolor)and(ichess[8,5]=compcolor)and(ichess[8,6]=none)and(ichess[7,3]=compcolor)and(ichess[7,4]=compcolor)and(ichess[7,5]=compcolor)and(ichess[7,6]=compcolor)then
    dec(addition,freehand);

if (ichess[3,1]=mancolor)and(ichess[4,1]=mancolor)and(ichess[5,1]=none)and(ichess[6,1]=mancolor)and(ichess[3,2]=mancolor)and(ichess[4,2]=mancolor)and(ichess[5,2]=mancolor)and(ichess[6,2]=mancolor)then
    inc(addition,freehand);
if (ichess[3,1]=mancolor)and(ichess[4,1]=none)and(ichess[5,1]=mancolor)and(ichess[6,1]=mancolor)and(ichess[3,2]=mancolor)and(ichess[4,2]=mancolor)and(ichess[5,2]=mancolor)and(ichess[6,2]=mancolor)then
    inc(addition,freehand);
if (ichess[1,3]=mancolor)and(ichess[1,4]=mancolor)and(ichess[1,5]=none)and(ichess[1,6]=mancolor)and(ichess[2,3]=mancolor)and(ichess[2,4]=mancolor)and(ichess[2,5]=mancolor)and(ichess[2,6]=mancolor)then
    inc(addition,freehand);
if (ichess[1,3]=mancolor)and(ichess[1,4]=mancolor)and(ichess[1,5]=mancolor)and(ichess[1,6]=none)and(ichess[2,3]=mancolor)and(ichess[2,4]=mancolor)and(ichess[2,5]=mancolor)and(ichess[2,6]=mancolor)then
    inc(addition,freehand);
if (ichess[3,8]=mancolor)and(ichess[4,8]=mancolor)and(ichess[5,8]=none)and(ichess[6,8]=mancolor)and(ichess[3,7]=mancolor)and(ichess[4,7]=mancolor)and(ichess[5,7]=mancolor)and(ichess[6,7]=mancolor)then
    inc(addition,freehand);
if (ichess[3,8]=mancolor)and(ichess[4,8]=none)and(ichess[5,8]=mancolor)and(ichess[6,8]=mancolor)and(ichess[3,7]=mancolor)and(ichess[4,7]=mancolor)and(ichess[5,7]=mancolor)and(ichess[6,7]=mancolor)then
    inc(addition,freehand);
if (ichess[8,3]=mancolor)and(ichess[8,4]=mancolor)and(ichess[8,5]=none)and(ichess[8,6]=mancolor)and(ichess[7,3]=mancolor)and(ichess[7,4]=mancolor)and(ichess[7,5]=mancolor)and(ichess[7,6]=mancolor)then
    inc(addition,freehand);
if (ichess[8,3]=mancolor)and(ichess[8,4]=mancolor)and(ichess[8,5]=mancolor)and(ichess[8,6]=none)and(ichess[7,3]=mancolor)and(ichess[7,4]=mancolor)and(ichess[7,5]=mancolor)and(ichess[7,6]=mancolor)then
    inc(addition,freehand);
}


  if (ichess[1, 1] = compcolor) and (ichess[1, 2] = none) and (ichess[2, 1] = none) then
  begin
    changechess(1, 2, compcolor, 0);
    if chessable = 0 then
    begin
      changechess(2, 1, compcolor, 0);
      if chessable = 0 then dec(addition, round(sqrt(cost[1, 1])) * 3 div 5);
    end;
  end;
  if (ichess[1, 8] = compcolor) and (ichess[1, 7] = none) and (ichess[2, 8] = none) then
  begin
    changechess(1, 7, compcolor, 0);
    if chessable = 0 then
    begin
      changechess(2, 8, compcolor, 0);
      if chessable = 0 then dec(addition, round(sqrt(cost[1, 8])) * 3 div 5);
    end;
  end;
  if (ichess[8, 1] = compcolor) and (ichess[7, 1] = none) and (ichess[8, 2] = none) then
  begin
    changechess(8, 2, compcolor, 0);
    if chessable = 0 then
    begin
      changechess(7, 1, compcolor, 0);
      if chessable = 0 then dec(addition, round(sqrt(cost[8, 1])) * 3 div 5);
    end;
  end;
  if (ichess[8, 8] = compcolor) and (ichess[8, 7] = none) and (ichess[7, 8] = none) then
  begin
    changechess(8, 7, compcolor, 0);
    if chessable = 0 then
    begin
      changechess(7, 8, compcolor, 0);
      if chessable = 0 then dec(addition, round(sqrt(cost[8, 8])) * 3 div 5);
    end;
  end;
  if (ichess[1, 1] = mancolor) and (ichess[1, 2] = none) and (ichess[2, 1] = none) then
  begin
    changechess(1, 2, mancolor, 0);
    if chessable = 0 then
    begin
      changechess(2, 1, mancolor, 0);
      if chessable = 0 then inc(addition, round(sqrt(cost[1, 1])) * 3 div 5);
    end;
  end;
  if (ichess[1, 8] = mancolor) and (ichess[1, 7] = none) and (ichess[2, 8] = none) then
  begin
    changechess(1, 7, mancolor, 0);
    if chessable = 0 then
    begin
      changechess(2, 8, mancolor, 0);
      if chessable = 0 then inc(addition, round(sqrt(cost[1, 8])) * 3 div 5);
    end;
  end;
  if (ichess[8, 1] = mancolor) and (ichess[7, 1] = none) and (ichess[8, 2] = none) then
  begin
    changechess(8, 2, mancolor, 0);
    if chessable = 0 then
    begin
      changechess(7, 1, mancolor, 0);
      if chessable = 0 then inc(addition, round(sqrt(cost[8, 1])) * 3 div 5);
    end;
  end;
  if (ichess[8, 8] = mancolor) and (ichess[8, 7] = none) and (ichess[7, 8] = none) then
  begin
    changechess(8, 7, mancolor, 0);
    if chessable = 0 then
    begin
      changechess(7, 8, mancolor, 0);
      if chessable = 0 then inc(addition, round(sqrt(cost[8, 8])) * 3 div 5);
    end;
  end;

  result := addition;
end;


end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -