public void computerMove() {
// 编码双方的棋局
int manMap = encodeManMap();
int computerMap = encodeComputerMap();
// 先看是否有致胜走法
int move = getWinningMove(computerMap);
if (move >= 0) {
this.sign[move] = 'o';
Point ch = new Point(xIndex, yIndex, Color.blue);
this.chessList[(this.chessCount++)] = ch;
return;
}
表示6是第三行第一个。
使用0-8对棋盘网格定位。
0 1 2
3 4 5
6 7 8
已知编号,求x y,比如6,它的x y是0, 2