由买买提看人间百态

topics

全部话题 - 话题: dscore
(共0页)
j*x
发帖数: 425
1
来自主题: JobHunting版 - 问个tictactoe的问题
public class TicTacToe {
int[][] board;
int[] hScore;//horizontal
int[] vScore;//vertical
int[] dScore;//diagnal

public TicTacToe(int n){
board=new int[n][n];
hScore=new int[n];
vScore=new int[n];
dScore=new int[2];
}

public void addMove(char c,int i,int j){
board[i][j]=c;
int n=board.length;
if(c=='X'){
hScore[i]-=1;
vScore[j]-=1;
if(i==j) dScore[0]-=1;
if(... 阅读全帖
(共0页)