diff --git a/SwichGIT/src/js/main.js b/SwichGIT/src/js/main.js index 706be65..82fc4d6 100644 --- a/SwichGIT/src/js/main.js +++ b/SwichGIT/src/js/main.js @@ -1241,7 +1241,13 @@ function chercherCombinaison() { for (var h = 0; h < DeckTeste.length; h++) { recup.push(deckPartie.indexOf(DeckTeste[h]) + 1); } - window.alert("Combinaison a " + (N + 2) + " cartes trouvée : " + recup); + if(!modelangue){ + window.alert("Combinaison a " + (N + 2) + " cartes trouvée : " + recup); + } + else{ + window.alert("Combination with " + (N + 2) + " cards found : " + recup); + } + } } } @@ -1284,7 +1290,13 @@ function printCombinations(array, p) { } } run(0, 0); - window.alert("fin test " + k + " cartes") + if(!modelangue){ + window.alert("fin test " + k + " cartes") + } + else{ + window.alert("end test " + k + " cards") + } + } window.alert("nb combi :" + Cptsolution); } @@ -1310,7 +1322,13 @@ function testCombinaison(DeckTeste, combi, Cptsolution) { //Reagarde si il y a une solution if (!solution) { Cptsolution++; - window.alert("Combinaison à " + (DeckTeste.length) + " cartes trouvée : " + combi); + if(!modelangue){ + window.alert("Combinaison à " + (DeckTeste.length) + " cartes trouvée : " + combi); + } + else{ + window.alert("Combination with " + (DeckTeste.length) + " cards found : " + combi); + } + } return Cptsolution; } @@ -1355,11 +1373,23 @@ function chercheCombi2() { } if (!solution) { Cptsolution++; - window.alert("Combinaison a 2 trouve: " + (i + 1) + " " + (i + j + 2)); + if(!modelangue){ + window.alert("Combinaison a 2 trouve: " + (i + 1) + " " + (i + j + 2)); + } + else{ + window.alert("Combination with 2 found: " + (i + 1) + " " + (i + j + 2)); + } + } } } - window.alert("Nombre de solution a 2 cartes : " + Cptsolution); + if(!modelangue){ + window.alert("Nombre de solution a 2 cartes : " + Cptsolution); + } + else{ + window.alert("Number of solutions with 2 cards : " + Cptsolution); + } + } //================================================================================= @@ -1443,15 +1473,33 @@ function chercheCombi3() { } if (!solution) { Cptsolution++; - window.alert("Combinaison a 3 trouve: " + (i + 1) + " " + (i + j + 2) + " " + (k + j + i + 3)); + if(!modelangue){ + window.alert("Combinaison a 3 trouve: " + (i + 1) + " " + (i + j + 2) + " " + (k + j + i + 3)); + } + else{ + window.alert("Combination with 3 found: " + (i + 1) + " " + (i + j + 2) + " " + (k + j + i + 3)); + } + } } } } if (Cptsolution == 0) { - window.alert("Pas de solution"); + if(!modelangue){ + window.alert("Pas de solution"); + } + else{ + window.alert("No solution"); + } + + } + if(!modelangue){ + window.alert("Nombre de solution a 3 cartes : " + Cptsolution); } - window.alert("Nombre de solution a 3 cartes : " + Cptsolution); + else{ + window.alert("Number of solutions with 3 cards : " + Cptsolution); + } + } @@ -1681,11 +1729,23 @@ function copieLiseDeFigure(Liste) { } function copieFigure(uneFigure) { - window.alert("Avant copiage " + uneFigure.CodeHTML) + if(!modelangue){ + window.alert("Avant copiage " + uneFigure.CodeHTML) + } + else{ + window.alert("Before copying " + uneFigure.CodeHTML) + } + if (uneFigure == null) { return null; } - window.alert("je fais la copie") + if(!modelangue){ + window.alert("je fais la copie"); + } + else{ + window.alert("I make the copy"); + } + var copie = new Figure(uneFigure.type, uneFigure.forme, uneFigure.X, uneFigure.Y); return copie; } @@ -1877,27 +1937,10 @@ function bacASable() { afficherCartes(lesCartes); } -/*function functionLange(){ - -if(lange % 2 == 0){ -//mode anglais -document.getElementById('flag_top').src = "imgs/flags/flag-uk.png"; -document.getElementById('textjouer').value = "PLAY"; - - -} -else{ -//mode français -document.getElementById('flag_top').src = "imgs/flags/flag-france.png"; -document.getElementById('textjouer').value = "JOUER"; -} -lange += 1; - - -}*/ function functionLange(){ //window.alert(modelangue); + if(modelangue){ modelangue = false; //MODE FRANCAIS ======= @@ -1948,17 +1991,3 @@ function functionLange(){ } } - -/*function trad(){ -//var flag_top = document.getElementById("flag_top"); - //var flag_bottom = document.getElementById("flag_bottom"); - mode = mode + 1; - if (mode % 2 == 0) { - - - } - else { - - } - -}*/