diff --git a/assets/scripts/keyboard.js b/assets/scripts/keyboard.js index 0656fec4..cb7924a5 100644 --- a/assets/scripts/keyboard.js +++ b/assets/scripts/keyboard.js @@ -191,7 +191,7 @@ function deleteLetter () { // CHECK IF GUESS IS CORRECT function guessPreprocess(){ - if ((lastActiveWord != null) && (activeWord==null)) { + if (lastActiveWord != null && activeWord==null) { activeWord = lastActiveWord; checkGuess() return; @@ -295,10 +295,10 @@ function updatePlayer(playerLst, activePlayer) { } playerLst.forEach((player) => { - if ((!player[0].classList.contains("submitted")) && player[0] != activePlayer[0]) { + if (!player[0].classList.contains("submitted") && player[0] != activePlayer[0]) { player[0].classList.remove("clicked", "fa-circle-stop"); stopSound(player[1]); - } else if ((!player[0].classList.contains("submitted")) && player[0] == activePlayer[0]) { + } else if (!player[0].classList.contains("submitted") && player[0] == activePlayer[0]) { activePlayer[0].classList.add("clicked","fa-circle-stop"); activePlayer[1].play(); } diff --git a/assets/scripts/practice.js b/assets/scripts/practice.js index f182126f..d32391ad 100644 --- a/assets/scripts/practice.js +++ b/assets/scripts/practice.js @@ -127,7 +127,7 @@ function deleteLetter () { } function guessPreprocess() { - if ((lastActiveWord != null) && (activeWord==null)) { + if (lastActiveWord != null && activeWord==null) { activeWord = lastActiveWord; checkGuess() return; @@ -204,10 +204,10 @@ function updatePlayer(playerLst, activePlayer) { } playerLst.forEach((player) => { - if ((!player[0].classList.contains("submitted")) && player[0] != activePlayer[0]) { + if (!player[0].classList.contains("submitted") && player[0] != activePlayer[0]) { player[0].classList.remove("clicked", "fa-circle-stop"); stopSound(player[1]); - } else if ((!player[0].classList.contains("submitted")) && player[0] == activePlayer[0]) { + } else if (!player[0].classList.contains("submitted") && player[0] == activePlayer[0]) { activePlayer[0].classList.add("clicked","fa-circle-stop"); activePlayer[1].play(); } diff --git a/assets/scripts/spelloff.js b/assets/scripts/spelloff.js index e04adc3f..0f7b7c10 100644 --- a/assets/scripts/spelloff.js +++ b/assets/scripts/spelloff.js @@ -112,7 +112,7 @@ function deleteLetter () { } function guessPreprocess() { - if ((lastActiveWord != null) && (activeWord==null)) { + if (lastActiveWord != null && activeWord==null) { activeWord = lastActiveWord; checkGuess() return; @@ -188,10 +188,10 @@ function updatePlayer(playerLst, activePlayer) { } playerLst.forEach((player) => { - if ((!player[0].classList.contains("submitted")) && player[0] != activePlayer[0]) { + if (!player[0].classList.contains("submitted") && player[0] != activePlayer[0]) { player[0].classList.remove("clicked", "fa-circle-stop"); stopSound(player[1]); - } else if ((!player[0].classList.contains("submitted")) && player[0] == activePlayer[0]) { + } else if (!player[0].classList.contains("submitted") && player[0] == activePlayer[0]) { activePlayer[0].classList.add("clicked","fa-circle-stop"); activePlayer[1].play(); } diff --git a/assets/scripts/wordLstGenerator.js b/assets/scripts/wordLstGenerator.js index d157208a..8321f44b 100644 --- a/assets/scripts/wordLstGenerator.js +++ b/assets/scripts/wordLstGenerator.js @@ -91,14 +91,14 @@ function genYoutubeWordLst(){ } wordLst = mediumWords - while ((result.length) < 20 && (result.length >= 10)) { + while (result.length < 20 && result.length >= 10) { var item = wordLst[Math.floor(YTrand()*wordLst.length)]; if (!result.includes(item)){ result.push(item) } } wordLst = hardWords - while ((result.length) < 100 && (result.length >= 20)) { + while (result.length < 100 && result.length >= 20) { var item = wordLst[Math.floor(YTrand()*wordLst.length)]; if (!result.includes(item)){ result.push(item) @@ -128,4 +128,4 @@ function genSpellOffWordLst(){ var diffTime = new Date(today).getTime() - new Date("1/12/2024").getTime(); var Difference_In_Days = Math.round(diffTime / (1000 * 3600 * 24)); var puzzleNum = Difference_In_Days -sessionStorage.setItem("puzzleNum", puzzleNum) \ No newline at end of file +sessionStorage.setItem("puzzleNum", puzzleNum) diff --git a/assets/scripts/youtube.js b/assets/scripts/youtube.js index 15571efe..e3a7e578 100644 --- a/assets/scripts/youtube.js +++ b/assets/scripts/youtube.js @@ -71,9 +71,9 @@ function checkLevel(level){ function updateWord(){ if (wordCounter < 10){ levelPath = "levelOneNEW" - } else if ((wordCounter >= 10) && (wordCounter<20)){ + } else if (wordCounter >= 10 && wordCounter<20){ levelPath = "levelTwoNEW" - }else if ((wordCounter >= 20) && (wordCounter<100)){ + }else if (wordCounter >= 20 && wordCounter<100){ levelPath = "levelThreeNEW" } wordLst = genYoutubeWordLst() @@ -118,7 +118,7 @@ function deleteLetter () { } function guessPreprocess() { - if ((lastActiveWord != null) && (activeWord==null)) { + if (lastActiveWord != null && activeWord==null) { activeWord = lastActiveWord; checkGuess() return; @@ -179,10 +179,10 @@ function updatePlayer(playerLst, activePlayer) { } playerLst.forEach((player) => { - if ((!player[0].classList.contains("submitted")) && player[0] != activePlayer[0]) { + if (!player[0].classList.contains("submitted") && player[0] != activePlayer[0]) { player[0].classList.remove("clicked", "fa-circle-stop"); stopSound(player[1]); - } else if ((!player[0].classList.contains("submitted")) && player[0] == activePlayer[0]) { + } else if (!player[0].classList.contains("submitted") && player[0] == activePlayer[0]) { activePlayer[0].classList.add("clicked","fa-circle-stop"); activePlayer[1].play(); }