From e459206eae214bf44944c51671928158b328cc44 Mon Sep 17 00:00:00 2001 From: Olivan Sahel Date: Thu, 1 Dec 2022 10:22:20 +0100 Subject: [PATCH 1/2] Sahem --- Page1.html | 1 + Puissance4.html | 13 ++++++++++--- style.css | 30 ++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 3 deletions(-) diff --git a/Page1.html b/Page1.html index 905d233..e634c08 100644 --- a/Page1.html +++ b/Page1.html @@ -3,6 +3,7 @@ + Projet Web diff --git a/Puissance4.html b/Puissance4.html index 8bb2a02..3475196 100644 --- a/Puissance4.html +++ b/Puissance4.html @@ -3,6 +3,7 @@ + Puissance 4 @@ -21,9 +22,15 @@
-
- -
+
+
1
+
2
+
3
+
4
+
5
+
6
+
+
diff --git a/style.css b/style.css index 1b64f13..abf721d 100644 --- a/style.css +++ b/style.css @@ -56,3 +56,33 @@ article footer{ margin-top: auto; } +#Puissance4Board{ + display: grid; + grid-template-columns: (6,7); + gap: 1em; + padding: 1em; +} +.one{ + grid-column: 1; + grid-row: 1; +} +.two{ + grid-column: 1; + grid-row: 1; +} +.three{ + grid-column: 1; + grid-row: 1; +} +.four{ + grid-column: 1; + grid-row: 1; +} +.five{ + grid-column: 1; + grid-row: 1; +} +.six{ + grid-column: 1; + grid-row: 1; +} From ed9734331e1e9be19a39bb0d5c3568e9c239dd13 Mon Sep 17 00:00:00 2001 From: Leopold Lanard Date: Thu, 1 Dec 2022 10:48:58 +0100 Subject: [PATCH 2/2] leo.js --- leo.js | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 leo.js diff --git a/leo.js b/leo.js new file mode 100644 index 0000000..997f7fe --- /dev/null +++ b/leo.js @@ -0,0 +1,47 @@ + +let Jeu= true; +let Joueuractuel; +/* + +function winverif(){ + +} +*/ +let cases = document.querySelectorAll(".case"); +for(let i = 0 ;i< cases.length;i++) +{ + Joueuractuel = i%2; + + if (Joueuractuel){ + + + cases[i].addEventListener("click",(event)=>{ + cases[i].innerHTML = "0"; + }) + } + else{ + cases[i].addEventListener("click",(event)=>{ + cases[i].innerHTML = "X"; + }) + } +} + + + +/* +document.getElementById("demo1").onclick = function() {myFunction()}; + + +function myFunction() { + document.getElementById("demo1").innerHTML = "O"; +} +document.getElementById("demo2").onclick = function() {myFunction()}; + +function myFunction() { + document.getElementById("demo2").innerHTML = "O"; +} +document.getElementById("demo3").onclick = function() {myFunction()}; + +function myFunction() { + document.getElementById("demo3").innerHTML = "O"; +}*/ \ No newline at end of file