全文预览

C语言编写象棋软件源代码

上传者:你的雨天 |  格式:doc  |  页数:24 |  大小:88KB

文档介绍
y)==2&&((x-oldx)==1||(oldx-x)==1)){?if(board[oldx][oldy+1]!=0)return0;}elseif((oldy-y)==2&&((x-oldx)==1||(oldx-x)==1)){?if(board[oldx][oldy-1]!=0)return0;}elsereturn0;?break;caseRED_PAO:/*完成*/if(x!=oldx&&y!=oldy)return0;if(board[x][y]==0){if(x!=oldx){min=(x>oldx)?oldx:x;max=(x>oldx)?x:oldx;for(i=min+1;i<max;i++)if(board[i][y]!=0)return0;}elseif(y!=oldy){min=(y>oldy)?oldy:y;max=(y>oldy)?y:oldy;for(i=min+1;i<max;i++)if(board[x][i]!=0)return0;}}else{if(x!=oldx){min=(x>oldx)?oldx:x;max=(x>oldx)?x:oldx;for(i=min+1,j=0;i<max;i++)if(board[i][y]!=0)j++;if(j!=1)return0;}elseif(y!=oldy){min=(y>oldy)?oldy:y;max=(y>oldy)?y:oldy;for(i=min+1,j=0;i<max;i++)if(board[x][i]!=0)j++;if(j!=1)return0;}}break;caseRED_SHI:/*完成*/if(oldx==9||oldx==7){if(x!=8||y!=4)return0;}elseif(oldx==8){if(x==9&&y==3)return1;else

收藏

分享

举报
下载此文档