五子棋游戏源代码(8)

时间:2025-02-22

【柯哀王道】左右两边的世界-作者:忧冷繁星

return this.modeChess;

}

//获取棋盘方格上棋子的信息

public int[][] getarrMapShow(){

return arrMapShow;

}

//判断下子的横向、纵向坐标是否越界

private boolean badxy(int x, int y){

if(x >= width+20 || x < 0)

return true;

return y >= height+20 || y < 0;

}

//计算棋盘上某一方格上八个方向棋子的最大值,

//这八个方向分别是:左、右、上、下、左上、左下、右上、右下

public boolean chessExist(int i,int j){

if(this.arrMapShow[i][j]==1 || this.arrMapShow[i][j]==2)

return true;

return false;

}

//判断该坐标位置是否可下棋子

public void readyplay(int x,int y){

if(badxy(x,y))

return;

if (chessExist(x,y))

return;

this.arrMapShow[x][y]=3;

}

//在该坐标位置下棋子

public void play(int x,int y){

if(badxy(x,y))

return;

if(chessExist(x,y)){

this.isExist=true;

return;

}else

this.isExist=false;

if(getisOdd()){

setisOdd(false);

this.arrMapShow[x][y]=1;

}else{

setisOdd(true);

this.arrMapShow[x][y]=2;

}

}

五子棋游戏源代码(8).doc 将本文的Word文档下载到电脑

精彩图片

热门精选

大家正在看

× 游客快捷下载通道(下载后可以自由复制和排版)

限时特价:7 元/份 原价:20元

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219