可编辑
if(x==9&&y==5) return 1;
else
if(x==7&&y==3) return 1;
else
if(x==7&&y==5) return 1;
else return 0;
}else return 0;
break;
case RED_XIANG: /*完成*/
if(x<5) return 0;
if(x!=oldx&&y!=oldy)
{
if((x-oldx)==2&&(y-oldy)==2)
{i=oldx+1;j=oldy+1;}
else if((x-oldx)==2&&(oldy-y)==2)
{i=oldx+1;j=oldy-1;}
else if((oldx-x)==2&&(y-oldy)==2)
{i=oldx-1;j=oldy+1;}
else if((oldx-x)==2&&(oldy-y)==2)
{i=oldx-1;j=oldy-1;}
else return 0;
if(board[i][j]!=0) return 0;
}
else return 0;
break;
}
return 1;
}
redup()
{
int x,y,n;
if(redcurpos.x>0)
{
redcurpos.x--;
x=position[redtemppos.x][redtemppos.y].x;
y=position[redtemppos.x][redtemppos.y].y;
if(board[redtemppos.x][redtemppos.y]==0)
drawbmp(x,y,boardfile[redtemppos.x][redtemppos.y]);
else if(!(redtemppos.x==redoldpos.x&&redtemppos.y==redoldpos.y&&redstate==MOVE)) {
n=board[redtemppos.x][redtemppos.y];
drawbmp(x,y,chessfile[n]);
}
.