java五子棋悔棋代码根据我的代码加

2024-07-19 01:48:34作者:饭克斯

//悔棋

publicvoidgoback(){

if(chessCount==0)//判断剩余棋子数

return;

chessList[chessCount-1]=null;//chessList是棋子数组

chessCount--;

if(chessCount>0){

xIndex=chessList[chessCount-1].getX();//xIndex,yIndex当前刚下棋子的索引

yIndex=chessList[chessCount-1].getY();

}

isBlack=!isBlack;

repaint();

}

展开全文

热门推荐

相关攻略

猜你喜欢