2
Here’s the code that says you’re Undefined:
function verifica_pos(row, col){
//Move para Sul
if (document.getElementById("table").rows[row - 3].cells[col].innerHTML == count_num - 1) {
return true;
}else if (document.getElementById("table").rows[row - 2].cells[col + 2].innerHTML == count_num - 1) { //Move para Sudoeste
return true;
}else if (document.getElementById("table").rows[row].cells[col + 3].innerHTML == count_num - 1) { //Move para Oeste
return true;
}else if (document.getElementById("table").rows[row + 2].cells[col + 2].innerHTML == count_num - 1) { //Move para Noroeste
return true;
}else if (document.getElementById("table").rows[row + 3].cells[col].innerHTML == count_num - 1) { //Move para Norte
return true;
}else if (document.getElementById("table").rows[row + 2].cells[col - 2].innerHTML == count_num - 1) {//Move para Nordeste
return true;
}else if (document.getElementById("table").rows[row].cells[col - 3].innerHTML == count_num - 1) { //Move para Este
return true;
}else if (document.getElementById("table").rows[row - 2].cells[col - 2].innerHTML == count_num - 1) { //Move para Sudeste
return true;
}else{
return false;
}
}
Where count_num is a variable of type Number that contains a number from 1 to 100.
Is it a table of 100 cells? 10 rows and 10 columns?
– Sam