
This function blows up (without an error) whenever it is called
function valid(n){ //n is a number 0-9
if(board[Math.floor(n/3)][n%3]==0){
return true;
}else{
return false;
}
}
where board is a global 3x3 Array matrix
var board = new Array(3);
board[0]=new Array(3);
board[1]=new Array(3);
board[2]=new Array(3);
The program at start fills board with all zeros. The valid(n) function breaks during the comparison and does not reach either return. I can not for the life of me figure why this doesn't work. Thanks in advance.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.