Skip to content

Instantly share code, notes, and snippets.

@tetsuzuki
Created March 6, 2014 09:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tetsuzuki/9386134 to your computer and use it in GitHub Desktop.
Save tetsuzuki/9386134 to your computer and use it in GitHub Desktop.
function Position(){
this.Board = [];
this.Capture = [];
this.Capture[0] = [];
this.Capture[1] = [];
this.FuFlg = [];
this.FuFlg[0] = [];
this.FuFlg[1] = [];
for(var i = 0; i <= 10; i++){
this.Board[i] = [];
for(var j = 0; j <= 10; j++){
this.Board[i][j] = OUT_OF_BOARD;
}
}
for(var i = 1; i <= 9; i++){
for(var j = 1; j <= 9; j++){
this.Board[i][j] = EMPTY;
}
}
for(var piece = FU; piece <= HI; piece++){
this.Capture[0][piece] = EMPTY;
this.Capture[1][piece] = EMPTY;
}
for(var i = 1; i <= 9; i++){
this.FuFlg[0][i] = false;
this.FuFlg[1][i] = false;
}
this.turn = true;
this.blackKingPos = new PiecePos(0,0);
this.whiteKingPos = new PiecePos(0,0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment