|
@ -115,26 +115,27 @@ function movePlayer(player, roll){ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//wandelt Zellennummer in html-Element um
|
|
|
|
|
|
function boardLocation(cellNumber){ |
|
|
|
|
|
var table = document.getElementById('board'); |
|
|
|
|
|
var found = false; |
|
|
|
|
|
var tableId; |
|
|
|
|
|
for(let i = 0; i < 10; i++){ |
|
|
|
|
|
for(let j = 0; j < 10; j++){//findet der zelle ID von Stellenummer
|
|
|
|
|
|
if(table.rows[i].cells[j].innerHTML == cellNumber){ |
|
|
|
|
|
found = 1; |
|
|
|
|
|
tableId = table.rows[i].cells[j].id; |
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
//wandelt Zellennummer in html-Element um
|
|
|
|
|
|
function boardLocation(cellNumber){ |
|
|
|
|
|
var table = document.getElementById('board'); |
|
|
|
|
|
var found = false; |
|
|
|
|
|
var tableId; |
|
|
|
|
|
for(let i = 0; i < 10; i++){ |
|
|
|
|
|
for(let j = 0; j < 10; j++){//findet der zelle ID von Stellenummer
|
|
|
|
|
|
if(table.rows[i].cells[j].id == ("cell" + cellNumber)){ |
|
|
|
|
|
found = 1; |
|
|
|
|
|
tableId = table.rows[i].cells[j].id; |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
if(found == true){ |
|
|
|
|
|
|
|
|
if(found == true){ |
|
|
|
|
|
|
|
|
return tableId; |
|
|
|
|
|
} |
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
|
return tableId; |
|
|
|
|
|
} |
|
|
|
|
|
else{ |
|
|
|
|
|
|
|
|
|
|
|
console.log("Error: Zellenummer " + tableId + " nicht gefunden"); //Druckt Errror auf dem console wenn unerfolgereich
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
console.log("Error: Zellenummer " + tableId + " nicht gefunden"); //Druckt Errror auf dem console wenn unerfolgereich
|
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|