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
536 B

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