|
|
@ -115,14 +115,14 @@ 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++){ |
|
|
|
//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){ |
|
|
|
if(table.rows[i].cells[j].id == ("cell" + cellNumber)){ |
|
|
|
found = 1; |
|
|
|
tableId = table.rows[i].cells[j].id; |
|
|
|
break; |
|
|
@ -137,4 +137,5 @@ for(let i = 0; i < 10; i++){ |
|
|
|
|
|
|
|
console.log("Error: Zellenummer " + tableId + " nicht gefunden"); //Druckt Errror auf dem console wenn unerfolgereich
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|