diff --git a/SwichGIT/Doc/Etudes formes/V1/script.js b/SwichGIT/Doc/Etudes formes/V1/script.js index c08c9bd..89da94a 100644 --- a/SwichGIT/Doc/Etudes formes/V1/script.js +++ b/SwichGIT/Doc/Etudes formes/V1/script.js @@ -20,4 +20,3 @@ function add(){ - diff --git a/SwichGIT/src/css/PartieGame.css b/SwichGIT/src/css/PartieGame.css index 301e8a3..169c90e 100644 --- a/SwichGIT/src/css/PartieGame.css +++ b/SwichGIT/src/css/PartieGame.css @@ -83,3 +83,26 @@ position: relative; transition: box-shadow 0.2s ease; } + +#progressbar +{ + position : relative; + width: 800px; + padding:1px; + background-color:white; + border:1px solid black; + height:10px; + border-radius: 5px; + margin-top: 80px; + + +} + +#indicateur +{ + width: 800px; + background-color : green; + height:10px; + margin: 0; + +} \ No newline at end of file diff --git a/SwichGIT/src/index.html b/SwichGIT/src/index.html index bb16043..0dd77ab 100644 --- a/SwichGIT/src/index.html +++ b/SwichGIT/src/index.html @@ -563,6 +563,7 @@
+

JOUER

@@ -658,6 +659,10 @@
+
+
+
+
diff --git a/SwichGIT/src/js/main.js b/SwichGIT/src/js/main.js index 24964bd..a73b5a7 100644 --- a/SwichGIT/src/js/main.js +++ b/SwichGIT/src/js/main.js @@ -784,6 +784,39 @@ function chercheCombi3() { for (var k = 0; k < 15 - j; k++) { //Partie movible 2 + + var DeckTeste = []; + var tabCode = []; + var tab = []; + var copie = []; + copie.splice(0, DeckTeste.length); + DeckTeste.splice(0, DeckTeste.length); + tab.splice(0, DeckTeste.length); + tabCode.splice(0, DeckTeste.length); + + DeckTeste.push(deckPartie[i]); + DeckTeste.push(deckPartie[j + i + 1]); + DeckTeste.push(deckPartie[k + j + i + 2]); + + for (var h = 0; h < DeckTeste.length; h++) { + copie.push(DeckTeste[i]); + } + + for (var z = 0; z < DeckTeste; z++) { + if (DeckTeste[z] == null) { + window.alert("Pb carte null :" + i + j + k); + } + } + + tab = AssemblageARBRE(copieListeDeCarte(DeckTeste), copieCarte(DeckTeste[0])); + var solution = true; + + for (var h = 0; h < tab.length; h++) { + tabCode.push(tab[h].code); + } + + + var DeckTeste = []; var tabCode = []; var tab = []; @@ -814,6 +847,7 @@ function chercheCombi3() { tabCode.push(tab[h].code); } + for (var g = 0; g < tab.length; g++) { if (tab[g].code == DeckTeste.length) { solution = false; @@ -836,6 +870,49 @@ function chercheCombi3() { //================================================================================= //FONCTION DE TEST => permet de tester des fonctionnalite via le bouton VALIDER + +var cpt = 801; +var x; +var itv = 0; + +function decompte() { + + var progressnum = document.getElementById("progressnum"); + var indicateur = document.getElementById("indicateur"); + + if (cpt >= 0) { + + cpt--; + x = setTimeout("decompte()", 100); + } + + else { + clearTimeout(x); + } + + if (cpt == 0) { + window.alert("fin du jeu"); + retour(); + window.location.reload(); + clearInterval(itv); + } + + if(cpt < 400) { + document.getElementById("indicateur").style.backgroundColor = "orange"; + + } + + if(cpt < 100) { + document.getElementById("indicateur").style.backgroundColor = "red"; + } + + indicateur.style.width = cpt + "px"; + progressnum.innerHTML = cpt; +} + + + + function testPourJeuInfini() { try { if (carteselect.length == 0) { @@ -900,6 +977,7 @@ function testPourJeuClassique() { for (var i = 0; i < tab.length; i++) { if (tab[i].code == carteselect.length) { solution = false; + cpt = cpt + 20 * copie.length; lesPoints += carteselect.length; document.getElementById("affPoints").textContent = 'Score : ' + lesPoints; changerlesCartesDeTasDeJeu();