You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
511 B
23 lines
511 B
function steinInReihe(reiheImFeld) {
|
|
// Feld mit Steinen in Reihe
|
|
// O = kein Stein
|
|
// 1 = gruener Stein
|
|
// 2 = roter Stein
|
|
var reihe = [];
|
|
|
|
for (let i = 1; i <= 7; i++) {
|
|
var color = document.getElementById(reiheImFeld + "/" + i).style.backgroundColor;
|
|
|
|
if (color == "red") {
|
|
reihe.push(2);
|
|
}else if (color == "green") {
|
|
reihe.push(1);
|
|
} else {
|
|
reihe.push(0);
|
|
}
|
|
}
|
|
|
|
return reihe;
|
|
|
|
|
|
}
|