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.

22 lines
511 B

  1. function steinInReihe(reiheImFeld) {
  2. // Feld mit Steinen in Reihe
  3. // O = kein Stein
  4. // 1 = gruener Stein
  5. // 2 = roter Stein
  6. var reihe = [];
  7. for (let i = 1; i <= 7; i++) {
  8. var color = document.getElementById(reiheImFeld + "/" + i).style.backgroundColor;
  9. if (color == "red") {
  10. reihe.push(2);
  11. }else if (color == "green") {
  12. reihe.push(1);
  13. } else {
  14. reihe.push(0);
  15. }
  16. }
  17. return reihe;
  18. }