Fonction Recherche Combinaison 2 Final

master
theo 4 years ago
parent 5a2ab32491
commit ef35056455

@ -503,10 +503,6 @@ function chercheCombi2() {
tab = AssemblageARBRE(copieListeDeCarte(DeckTeste), copieCarte(DeckTeste[0])); tab = AssemblageARBRE(copieListeDeCarte(DeckTeste), copieCarte(DeckTeste[0]));
//window.alert(DeckTeste[(j + i) + 1].getIdentifiant);
//window.alert("Combinaison : " + DeckTeste[i].getIdentifiant + DeckTeste[(j + i) + 1].getIdentifiant); //+1 au niveau des identifiants
//Pb DeckTeste[j + i + 1] marche pas
var solution = true; var solution = true;
@ -514,24 +510,22 @@ function chercheCombi2() {
tabCode.push(tab[h].code); tabCode.push(tab[h].code);
} }
//window.alert(tabCode);
for (var g = 0; g < tab.length; g++) { for (var g = 0; g < tab.length; g++) {
if (tab[g].code == carteselect.length) { if (tab[g].code == DeckTeste.length) {
solution = false; solution = false;
//window.alert("yo mec");
} }
} }
if (!solution) { if (!solution) {
Cptsolution++; Cptsolution++;
//window.alert("Nb Solution: " + Cptsolution); window.alert("Combinaison a 2 trouvé: " + (i+1) + " " + (i + j + 2));
} }
//window.alert("i= "+i+"j="+j);
} }
} }
window.alert("yo mec"); window.alert("Nombre de solution à 2 cartes : " + Cptsolution);
window.alert("Nombre de solution à 2 cartes : ", Cptsolution);
} }
//================================================================================= //=================================================================================
//FONCTION DE TEST => permet de tester des fonctionnalité via le bouton VALIDER //FONCTION DE TEST => permet de tester des fonctionnalité via le bouton VALIDER

Loading…
Cancel
Save