|
|
@ -307,6 +307,7 @@ function lancerpartie() {
|
|
|
|
function retour() {
|
|
|
|
function retour() {
|
|
|
|
document.getElementById("pageAccueil").style.visibility = "visible";
|
|
|
|
document.getElementById("pageAccueil").style.visibility = "visible";
|
|
|
|
document.getElementById("pageGame").style.visibility = "hidden";
|
|
|
|
document.getElementById("pageGame").style.visibility = "hidden";
|
|
|
|
|
|
|
|
window.location.reload();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function rechargerGAME() {
|
|
|
|
function rechargerGAME() {
|
|
|
@ -728,7 +729,6 @@ function testCombinaison(DeckTeste, combi, Cptsolution) {
|
|
|
|
return Cptsolution;
|
|
|
|
return Cptsolution;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function chercheCombi2() {
|
|
|
|
function chercheCombi2() {
|
|
|
|
|
|
|
|
|
|
|
|
var Cptsolution = 0;
|
|
|
|
var Cptsolution = 0;
|
|
|
@ -786,6 +786,7 @@ function chercheCombi3() {
|
|
|
|
|
|
|
|
|
|
|
|
for (var k = 0; k < 15 - j; k++) { //Partie movible 2
|
|
|
|
for (var k = 0; k < 15 - j; k++) { //Partie movible 2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var DeckTeste = [];
|
|
|
|
var DeckTeste = [];
|
|
|
|
var tabCode = [];
|
|
|
|
var tabCode = [];
|
|
|
|
var tab = [];
|
|
|
|
var tab = [];
|
|
|
@ -816,6 +817,39 @@ function chercheCombi3() {
|
|
|
|
tabCode.push(tab[h].code);
|
|
|
|
tabCode.push(tab[h].code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (var g = 0; g < tab.length; g++) {
|
|
|
|
for (var g = 0; g < tab.length; g++) {
|
|
|
|
if (tab[g].code == DeckTeste.length) {
|
|
|
|
if (tab[g].code == DeckTeste.length) {
|
|
|
|
solution = false;
|
|
|
|
solution = false;
|
|
|
@ -838,6 +872,49 @@ function chercheCombi3() {
|
|
|
|
//=================================================================================
|
|
|
|
//=================================================================================
|
|
|
|
//FONCTION DE TEST => permet de tester des fonctionnalite via le bouton VALIDER
|
|
|
|
//FONCTION DE TEST => permet de tester des fonctionnalite via le bouton VALIDER
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var cpt = 1100;
|
|
|
|
|
|
|
|
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 < 550) {
|
|
|
|
|
|
|
|
document.getElementById("indicateur").style.backgroundColor = "orange";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(cpt < 366) {
|
|
|
|
|
|
|
|
document.getElementById("indicateur").style.backgroundColor = "red";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
indicateur.style.width = cpt + "px";
|
|
|
|
|
|
|
|
progressnum.innerHTML = cpt;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function testPourJeuInfini() {
|
|
|
|
function testPourJeuInfini() {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if (carteselect.length == 0) {
|
|
|
|
if (carteselect.length == 0) {
|
|
|
@ -902,6 +979,7 @@ function testPourJeuClassique() {
|
|
|
|
for (var i = 0; i < tab.length; i++) {
|
|
|
|
for (var i = 0; i < tab.length; i++) {
|
|
|
|
if (tab[i].code == carteselect.length) {
|
|
|
|
if (tab[i].code == carteselect.length) {
|
|
|
|
solution = false;
|
|
|
|
solution = false;
|
|
|
|
|
|
|
|
cpt = cpt + 20 * copie.length;
|
|
|
|
lesPoints += carteselect.length;
|
|
|
|
lesPoints += carteselect.length;
|
|
|
|
document.getElementById("affPoints").textContent = 'Score : ' + lesPoints;
|
|
|
|
document.getElementById("affPoints").textContent = 'Score : ' + lesPoints;
|
|
|
|
changerlesCartesDeTasDeJeu();
|
|
|
|
changerlesCartesDeTasDeJeu();
|
|
|
|