Skip to content

Instantly share code, notes, and snippets.

@tetsuzuki tetsuzuki/pos.js
Last active Aug 29, 2015

Embed
What would you like to do?
function Pos(dan,suji){
this.dan = dan;
this.suji = suji;
}
var showBoard = function(){
for(var dan = 1; dan <= 9; dan++){
for(var suji = 1; suji <= 9; suji++){
//中略
if(board[dan][suji] == EMPTY){ //もしマスに駒がなければ
(function(){
var emp_pos = new Pos(dan,suji);
c.onclick = function(){
SelectEmptyCell(emp_pos);
}
})();
}
//中略
}
}
//中略
}
var SelectEmptyCell = function(pos){
//中略
if(selectedFlgB){
board[pos.dan][pos.suji] = selectedKoma;
board[FromClickDan][FromClickSuji] = EMPTY;
selectedFlgB = false;
selectedFlgC = false;
//中略
}
//中略
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.