From 6d1c191759d34150c312205ca2f3e99044c58a7a Mon Sep 17 00:00:00 2001 From: "Lorenzo O. Zimbres" <97912499+LoriaLawrenceZ@users.noreply.github.com> Date: Tue, 5 Sep 2023 18:19:17 +0000 Subject: [PATCH 1/2] comentando --- js/jogoDaVelha.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/js/jogoDaVelha.js b/js/jogoDaVelha.js index febd931..d6ba324 100644 --- a/js/jogoDaVelha.js +++ b/js/jogoDaVelha.js @@ -96,6 +96,7 @@ document.addEventListener("DOMContentLoaded", () => { iniciarCronometro(); } + //Durante o jogo, ao clicar na celula escolhida cells.forEach(cell => { const circuloImg = cell.querySelector(".circulo"); const xImg = cell.querySelector(".x"); @@ -148,28 +149,29 @@ document.addEventListener("DOMContentLoaded", () => { const cellB = cells[b]; const cellC = cells[c]; - let symbolA = ""; - let symbolB = ""; - let symbolC = ""; + let simboloA = ""; + let simboloB = ""; + let simboloC = ""; + //Checar qual o simbolo na celula em questão if (cellA.querySelector(".x.ativado")) { - symbolA = "X"; + simboloA = "X"; } else if (cellA.querySelector(".circulo.ativado")) { - symbolA = "O"; + simboloA = "O"; } if (cellB.querySelector(".x.ativado")) { - symbolB = "X"; + simboloB = "X"; } else if (cellB.querySelector(".circulo.ativado")) { - symbolB = "O"; + simboloB = "O"; } if (cellC.querySelector(".x.ativado")) { - symbolC = "X"; + simboloC = "X"; } else if (cellC.querySelector(".circulo.ativado")) { - symbolC = "O"; + simboloC = "O"; } - if (symbolA === symbolB && symbolB === symbolC && symbolA !== "") { - if(symbolA == "O"){ + if (simboloA === simboloB && simboloB === simboloC && simboloA !== "") { + if(simboloA == "O"){ document.querySelector(".msg-vitoria h1").innerHTML = "O VENCEU!"; document.querySelector(".msg-vitoria h1").style.color = "var(--vermelho-pastel)"; From 7c528a0571bb59c0c68d3462ba4a0fa6185773ca Mon Sep 17 00:00:00 2001 From: "Lorenzo O. Zimbres" <97912499+LoriaLawrenceZ@users.noreply.github.com> Date: Tue, 5 Sep 2023 18:44:55 +0000 Subject: [PATCH 2/2] comentando html --- html/jogoDaVelha.html | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/html/jogoDaVelha.html b/html/jogoDaVelha.html index f20df35..924fab7 100644 --- a/html/jogoDaVelha.html +++ b/html/jogoDaVelha.html @@ -14,6 +14,7 @@ +