From 2a607e11bfd2c56242c1411474d42b3d80d1ad70 Mon Sep 17 00:00:00 2001 From: Lucas Thenert Date: Mon, 30 Jan 2023 17:29:37 +0100 Subject: [PATCH] refactoring: Funktion naechster Spieler --- kniffel/inc/helper.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kniffel/inc/helper.js b/kniffel/inc/helper.js index 19e613a..da5dd9e 100644 --- a/kniffel/inc/helper.js +++ b/kniffel/inc/helper.js @@ -1,10 +1,10 @@ function moeglicheWuerfeZuruecksetzen(){ document.getElementById('erlaubteVersuche').innerHTML = '3'; - document.getElementById('CheckBoxWuerfel1').checked = false; - document.getElementById('CheckBoxWuerfel2').checked = false; - document.getElementById('CheckBoxWuerfel3').checked = false; - document.getElementById('CheckBoxWuerfel4').checked = false; - document.getElementById('CheckBoxWuerfel5').checked = false; + for(let i = 1; i <= 5; i++){ + document.getElementById('CheckBoxWuerfel' + i).checked = false; + } + + alert('Der nächste Spieler ist an der Reihe!'); } function dreierPasch(spieler){