第一范文网 - 专业文章范例文档资料分享平台

黑白棋

来源:用户分享 时间:2025/5/25 1:12:46 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

}

}

}

if(ComChoice==1) return(black(tb)-white(tb)); else return(white(tb)-black(tb));

//′??úo?àí2? else{

if(flag-ManChoice==0) return min; if(flag-ComChoice==0){ }

return max;

}

void CBwfind::newboard(int tb[][8],int chessx, int chessy, int flag) {

int x=chessx,y=chessy; //×óé? tb[x][y]=flag; if(x>=2&&y>=2)

if(tb[x-1][y-1]+flag==0){

x=x-2; y=y-2;

while(x>=0&&y>=0){

if(tb[x][y]==flag){ }

else if(tb[x][y]==0){x=-1;y=-1;} {x--;y--;}

for(int i=x,j=y;i!=chessx&&j!=chessy;i++,j++)

tb[i][j]=flag;

x=0;y=0;

}

}

//é? x=chessx; y=chessy; if(x>=2)

if(tb[x-1][y]+flag==0){ }

x=x-2; while(x>=0){ }

if(tb[x][y]==flag){ }

else if(tb[x][y]==0){x=-1;y=-1;} x--;

for(int i=x;i!=chessx;i++)

tb[i][chessy]=flag;

x=0;

//óòé? x=chessx; y=chessy; if(x>=2&&y<=5)

if(tb[x-1][y+1]+flag==0){

x=x-2;y=y+2; while(x>=0&&y<=7){

if(tb[x][y]==flag){ }

for(int i=x,j=y;i!=chessx&&j!=chessy;i++,j--)

tb[i][j]=flag;

x=0;y=7;

}

}

else if(tb[x][y]==0){x=-1;} {x--;y++;}

//óò x=chessx; y=chessy; if(y<=5)

if(tb[x][y+1]+flag==0){ }

y=y+2; while(y<=7){ }

if(tb[x][y]==flag){ }

else if(tb[x][y]==0){y=8;} y++;

for(int j=y;j!=chessy;j--)

tb[chessx][j]=flag;

y=7;

//óò?? x=chessx; y=chessy; if(x<=5&&y<=5)

if(tb[x+1][y+1]+flag==0){

x=x+2;y=y+2; while(x<=7&&y<=7){

if(tb[x][y]==flag){

for(int i=x,j=y;i!=chessx&&j!=chessy;i--,j--)

tb[i][j]=flag;

}

}

}

x=7;y=7;

else if(tb[x][y]==0){x=8;y=8;} {x++;y++;}

//?? x=chessx; y=chessy; if(x<=5)

if(tb[x+1][y]+flag==0){ }

x=x+2; while(x<=7){ }

if(tb[x][y]==flag){ }

else if(tb[x][y]==0){x=8;} x++;

for(int i=x;i!=chessx;i--)

tb[i][chessy]=flag;

x=7;

//×ó?? x=chessx; y=chessy; if(x<=5&&y>=2)

if(tb[x+1][y-1]+flag==0){

x=x+2;y=y-2; while(x<=7&&y>=0){

搜索更多关于: 黑白棋 的文档
黑白棋.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c64jh415tju35m4y30uvy_4.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top