From 5d6441e1151b5ac5dba262e630dd7c7439ac3813 Mon Sep 17 00:00:00 2001 From: algolfier Date: Sat, 6 Mar 2021 19:53:18 +0100 Subject: [PATCH 1/9] bug corrections --- SwichGIT/src/js/main.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/SwichGIT/src/js/main.js b/SwichGIT/src/js/main.js index 7148d9c..fec7182 100644 --- a/SwichGIT/src/js/main.js +++ b/SwichGIT/src/js/main.js @@ -2275,12 +2275,6 @@ function testPourJeuInfini() { } } if (solution) { - - document.getElementById("affSolution").textContent = 'Aucune solution trouvée...'; - } - if (!solution) { - document.getElementById("affSolution").textContent = 'Assemblage de ' + copie.length + ' cartes trouvé !'; - if(!modelangue){ document.getElementById("affSolution").textContent = 'Aucune solution trouvée...'; } @@ -2348,9 +2342,6 @@ function testPourJeuClassique() { } } if (solution) { - - document.getElementById("affSolution").textContent = 'Aucune solution trouvée...'; - if(!modelangue){ document.getElementById("affSolution").textContent = 'Aucune solution trouvée...'; } From a1d1f4bf7e7e20525454a7c0ef529621934298b8 Mon Sep 17 00:00:00 2001 From: algolfier Date: Sat, 6 Mar 2021 20:00:32 +0100 Subject: [PATCH 2/9] doublons --- SwichGIT/src/js/main.js | 50 ++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/SwichGIT/src/js/main.js b/SwichGIT/src/js/main.js index fec7182..4aa715c 100644 --- a/SwichGIT/src/js/main.js +++ b/SwichGIT/src/js/main.js @@ -11,15 +11,12 @@ var darktercia = "#606060"; var carteselect = []; var deckPartie = []; //Ensemble des cartes affichees a l'ecran var TasDuJEU = []; // Ensemble de toutes les cartes presente dans le jeu -var allMode = ["Match à Point", "Mode Timer", "Infini", "Bac"]; // Défini tout les modes de Jeu var allDimension = ["4 * 3", "3 * 3", "3 * 2", "2 * 2"];// Défini toutes les dimensions que les cartes peuvent avoir var selectionMode = 0; var selectionDiemension = 0; var allModeFrench = ["Match à Point", "Mode Timer", "Infini", "Bac"]; // Défini tout les modes de Jeu en français var allModeEngl = ["Point Match", "Timer mode", "Infini", "Bac"]; // Défini tout les modes de Jeu en Anglais -var allDimension = ["4 * 3", "3 * 3", "3 * 2", "2 * 2"];// Défini toutes les dimensions que les cartes peuvent avoir -var selectionMode = 0; -var selectionDiemension = 0; + var modelangue = false; @@ -33,22 +30,35 @@ function majSizeCard(column) { document.documentElement.style.setProperty('--tailleTablette', newTailleTablette + "vw"); } function modePrec() { - if (selectionMode == 0) { - selectionMode = allMode.length - 1; - } else { + if(!modelangue){ + if (selectionMode == 0) { + selectionMode = allModeFrench.length - 1; + } + else { selectionMode -= 1; + } + document.getElementById("textmode").textContent = "" + allModeFrench[selectionMode] + } + else{ + if (selectionMode == 0) { + selectionMode = allModeEngl.length - 1; + } + else { + selectionMode -= 1; + } + document.getElementById("textmode").textContent = "" + allModeEngl[selectionMode] } - document.getElementById("textmode").textContent = "" + allMode[selectionMode] } + -function modeSuiv() { +/*function modeSuiv() { if (selectionMode == allMode.length - 1) { selectionMode = 0; } else { selectionMode += 1; } document.getElementById("textmode").textContent = "" + allMode[selectionMode] -} +}*/ function dimensionPrec() { if (selectionDiemension == 0) { @@ -898,8 +908,6 @@ function lancerpartie() { majSizeCard(2); } else if (selectionDiemension == 3) { - window.alert("Oups, il semblerait que ce mode ne soit pas encore disponible..."); - if(!modelangue){ window.alert("Oups, il semblerait que ce mode ne soit pas encore disponible..."); } @@ -1726,7 +1734,13 @@ function chercherCombinaison() { } } } - window.alert("Nombre de combinaison: " + Cptsolution); + if(!modelangue){ + window.alert("Nombre de combinaison: " + Cptsolution); + } + else{ + window.alert("Number of combination: " + Cptsolution); + } + } function testPertinent() { @@ -1818,7 +1832,13 @@ function testAllEnsemble(liste) { if (!solution) { selectionAuto(liste[i].ensemble); //console.log("==========================") - console.log("Combinaison à " + (lesCartes.length) + " cartes trouvée : " + liste[i].ensemble); + if(!modelangue){ + console.log("Combinaison à " + (lesCartes.length) + " cartes trouvée : " + liste[i].ensemble); + } + else { + console.log("Combination with " + (lesCartes.length) + " cards found : " + liste[i].ensemble); + } + compteur++; //console.log(sommeCarreElement(liste[i].ensemble)) } @@ -1954,8 +1974,6 @@ function printCombinations(array, p) { } run(0, 0); - window.alert("fin test " + k + " cartes") - if(!modelangue){ window.alert("fin test " + k + " cartes") } From b4cb4dd8f1847c80a992aed8c46802b15ca3233c Mon Sep 17 00:00:00 2001 From: algolfier Date: Sat, 6 Mar 2021 20:25:04 +0100 Subject: [PATCH 3/9] =?UTF-8?q?petits=20probl=C3=A8mes=20r=C3=A9solus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SwichGIT/src/index.html | 2 +- SwichGIT/src/js/main.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/SwichGIT/src/index.html b/SwichGIT/src/index.html index e1e05be..7e843f1 100644 --- a/SwichGIT/src/index.html +++ b/SwichGIT/src/index.html @@ -76,7 +76,7 @@ diff --git a/SwichGIT/src/js/main.js b/SwichGIT/src/js/main.js index 4aa715c..c4a70f3 100644 --- a/SwichGIT/src/js/main.js +++ b/SwichGIT/src/js/main.js @@ -2650,7 +2650,7 @@ function functionLange(){ document.getElementById('lesRegles').textContent = 'Les Règles'; document.getElementById('textRules').textContent = 'Swish : Jeu de 60 cartes composé chacun de billes et de cerceaux, de 4 couleurs différentes possibles. 16 cartes sont posés sur une table et le joueur doit faire superposer des cartes de manière que chaque bille soit dans le cerceau de même couleur d’une autre carte.'; - + document.getElementById("textmode").textContent = "" + allModeFrench[selectionMode] } else{ @@ -2676,6 +2676,7 @@ function functionLange(){ document.getElementById('lesRegles').textContent = 'The Rules'; document.getElementById('textRules').textContent = 'Swish : Set of 60 cards each composed of balls and hoops, 4 different colors possible. 16 cards are placed on a table and the player has to lay cards on top of each other in such a way that each ball is in the same color hoop as another card.' + document.getElementById("textmode").textContent = "" + allModeEngl[selectionMode] } } From 024eda3e2c319de86b6abff3b646fadb0d277fd0 Mon Sep 17 00:00:00 2001 From: algolfier Date: Sun, 7 Mar 2021 18:33:14 +0100 Subject: [PATCH 4/9] suppression dossiers inutiles --- SwichGIT/BDD/css.css | 0 SwichGIT/BDD/javasBDD.js | 128 ---------------- SwichGIT/BDD/js.js | 51 ------- SwichGIT/BDD/morpion.db | Bin 12288 -> 0 bytes SwichGIT/BDD/p1.html | 18 --- SwichGIT/BDD/p2.html | 44 ------ SwichGIT/ServerPyt/.idea/ServerPyt.iml | 8 - .../inspectionProfiles/Project_Default.xml | 12 -- .../inspectionProfiles/profiles_settings.xml | 6 - SwichGIT/ServerPyt/.idea/misc.xml | 4 - SwichGIT/ServerPyt/.idea/modules.xml | 8 - SwichGIT/ServerPyt/.idea/vcs.xml | 6 - SwichGIT/ServerPyt/.idea/workspace.xml | 140 ------------------ SwichGIT/ServerPyt/client.py | 40 ----- SwichGIT/ServerPyt/server.py | 62 -------- 15 files changed, 527 deletions(-) delete mode 100644 SwichGIT/BDD/css.css delete mode 100644 SwichGIT/BDD/javasBDD.js delete mode 100644 SwichGIT/BDD/js.js delete mode 100644 SwichGIT/BDD/morpion.db delete mode 100644 SwichGIT/BDD/p1.html delete mode 100644 SwichGIT/BDD/p2.html delete mode 100644 SwichGIT/ServerPyt/.idea/ServerPyt.iml delete mode 100644 SwichGIT/ServerPyt/.idea/inspectionProfiles/Project_Default.xml delete mode 100644 SwichGIT/ServerPyt/.idea/inspectionProfiles/profiles_settings.xml delete mode 100644 SwichGIT/ServerPyt/.idea/misc.xml delete mode 100644 SwichGIT/ServerPyt/.idea/modules.xml delete mode 100644 SwichGIT/ServerPyt/.idea/vcs.xml delete mode 100644 SwichGIT/ServerPyt/.idea/workspace.xml delete mode 100644 SwichGIT/ServerPyt/client.py delete mode 100644 SwichGIT/ServerPyt/server.py diff --git a/SwichGIT/BDD/css.css b/SwichGIT/BDD/css.css deleted file mode 100644 index e69de29..0000000 diff --git a/SwichGIT/BDD/javasBDD.js b/SwichGIT/BDD/javasBDD.js deleted file mode 100644 index 3bc1694..0000000 --- a/SwichGIT/BDD/javasBDD.js +++ /dev/null @@ -1,128 +0,0 @@ - -const sqlite3 = require('sqlite3').verbose(); -const nomBDD = "morpion.db" -let db = new sqlite3.Database(nomBDD, sqlite3.OPEN_READWRITE, (err) => { - if (err) { - return console.error(err.message); - } - console.log('Connexion reussi a :', nomBDD); -}); - - - -function GenereChaine(){ - var texte = ""; - var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; - for (var i = 0; i < 8; i++) - texte += possible.charAt(Math.floor(Math.random() * possible.length)); - - return texte; -} - -function Insertion(table, colonne, valeur, colonne2, valeur2) { - db.run("UPDATE '" + table + "' SET " + colonne + " = " + valeur + " WHERE " + colonne2 + " = '" + valeur2 + "'") - console.log("Insertion de " + valeur + " reussi") -} - -function RecuperValeur(table, colonne, colonne2, valeur) { - var retour; - db.all("SELECT " +colonne+ " FROM " +table+ " WHERE " +colonne2+ "='" +valeur+"'", (err, data) => { - //console.log(data); - retour=data; - return retour; - }); - -} -var res = db.run("SELECT * FROM partie"); -console.log(res); - - -function InitialserBDD(){ - db.run('INSERT INTO PARTIE(id) VALUES(?)', [GenereChaine()]); -} - -function SupprimerLigne(id){ - db.run("DELETE FROM PARTIE where id='"+id+"'"); -} - -InitialserBDD(); -//Insertion("PARTIE","ptsj1","1","id","96FVGDWY"); -var dfs= RecuperValeur("PARTIE","ptsJ1","id","UFS6ySfL"); -console.log(dfs); - - - -/* -let sql = `SELECT * FROM PARTIE`; -db.all(sql, [], (err, rows) => { - if (err) { - throw err; - } - rows.forEach((row) => { - console.log(row.name); - }); -}); -*/ - -//ouverture de la base de donn� -/* -function test() { - var fullname; - var fname = "ptsj2"; - let sql = 'SELECT * FROM PARTIE'; - db.each(sql, [fname], (err, row) => { - if (err) { - throw err; - } - fullname = ('${row.Name}'); - alert(fullname);; - }); - db.close(); -} - -test(); - -*/ -/* -Insertion("PARTIE", "ptsJ1", 4, "id", "UFS6ySfL"); -Insertion("PARTIE", "ptsJ2", 100, "id", "UFS6ySfL"); - -Insertion("PARTIE", "ptsJ2", 10, "id", "96FVGDWY"); - -*/ - -//db.run('CREATE TABLE PARTIE(id varchar(8),ptsJ1 int,ptsj2 int)'); - - -//db.run('INSERT INTO score(id) VALUES(?)', ["J1"]) -//db.run('INSERT INTO score(id) VALUES(?)', ["J2"]) - -//UPDATE SCORE SET 'Two' = 2 WHERE ID = 'J1' - -db.all("SELECT * FROM PARTIE", (err, rows) => { - var res=""; - if (err) { - throw err - } - console.log("Affichage de la table partie\n") - rows.forEach((row)=>{ - res=res+row.name; - console.log(res); - - }); - - - -}); - - - -// fermeture de la base de donn� -db.close((err) => { - if (err) { - return console.error(err.message); - } - console.log('Fermeture de la base de donnes :',nomBDD); -}); - - diff --git a/SwichGIT/BDD/js.js b/SwichGIT/BDD/js.js deleted file mode 100644 index a723467..0000000 --- a/SwichGIT/BDD/js.js +++ /dev/null @@ -1,51 +0,0 @@ -function sdf(){ - window.alert("lksjdf"); -} - - -function creerPartie(){ - localStorage.setItem("nomJoueur", "J1"); -} - -function affichage(){ - document.getElementById("instructions").innerHTML = localStorage.getItem("nomJoueur"); - if( localStorage.getItem("nomJoueur") == 'J1'){ - document.getElementById("messages").innerHTML = "Tu joues les croix" - } - else{ - document.getElementById("messages").innerHTML = "Tu joues les ronds" - window.alert(localStorage.getItem("nomJoueur")); - } -} - - -function ValidateEmail(entre) -{ - if (entre!="X" ||(entre !="x")) - { - return (true) - } - alert("You have entered an invalid email address!") - return (false) -} - -/* -function rejoindrepartie(){ - localStorage.setItem("nomJoueur", "J2"); -} - -function Tourdequi(joueur){ - if(tab j1 + tabj2 .lenght %2==0){ - return J1; - } - - return J2; -} - -function finirpartie(){ - localStorage.removeItem("nomJoueur"); -} - -localStorage.setItem("lastname", "Smith"); -// Retrieve -document.getElementById("result").innerHTML = localStorage.getItem("lastname"); */ \ No newline at end of file diff --git a/SwichGIT/BDD/morpion.db b/SwichGIT/BDD/morpion.db deleted file mode 100644 index 1db8d2d1b4a96933e15ffd260a039daebbc1003d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI#F>KR76b9gT_T@?;$!q8kMJSTTMye1_s+LaFv}qI*p|%O2b~A2DQzZ?gZc7*$ z85tSb=*EPEgcuna5CdXlWPy#5vwf8c5;IcupXB@ByR%OA=gIB$Rxj#0JHyc+h@2Wt zkr1@xI7C#_m#weUVd+AiHaf+b`d?*@uHN{P)4LWAh~Mc60|F3$00bZa0SG_<0uX=z z1R!wU1#VlaSSpEe6x{E3*Sw8Rv!2fO@No>0YNQH05P2jOtkO(yG)(~_mLhq>1(vrcq8Opb{E&Gk<|@dy6J zKlnX=7oT~K;O_-)psQKW@%2vOzpOvyqw0t;r o!^cOa+4B33<_2Nbj<*JD3yuEqtuSZF@}yXtU%lH{xwo154HL(0AOHXW diff --git a/SwichGIT/BDD/p1.html b/SwichGIT/BDD/p1.html deleted file mode 100644 index ed469f3..0000000 --- a/SwichGIT/BDD/p1.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - Morpion - - - - -

-

- - - - - - - diff --git a/SwichGIT/BDD/p2.html b/SwichGIT/BDD/p2.html deleted file mode 100644 index 35844be..0000000 --- a/SwichGIT/BDD/p2.html +++ /dev/null @@ -1,44 +0,0 @@ - - - - - Morpion p2 - - - - - -
-

Morpion

-
-
-

-
-
-

Click in a box to play

-
-
- - - - -
- - - -
- - - -
- - - -
- - - - - - - diff --git a/SwichGIT/ServerPyt/.idea/ServerPyt.iml b/SwichGIT/ServerPyt/.idea/ServerPyt.iml deleted file mode 100644 index d0876a7..0000000 --- a/SwichGIT/ServerPyt/.idea/ServerPyt.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/SwichGIT/ServerPyt/.idea/inspectionProfiles/Project_Default.xml b/SwichGIT/ServerPyt/.idea/inspectionProfiles/Project_Default.xml deleted file mode 100644 index 40985a1..0000000 --- a/SwichGIT/ServerPyt/.idea/inspectionProfiles/Project_Default.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - \ No newline at end of file diff --git a/SwichGIT/ServerPyt/.idea/inspectionProfiles/profiles_settings.xml b/SwichGIT/ServerPyt/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 105ce2d..0000000 --- a/SwichGIT/ServerPyt/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/SwichGIT/ServerPyt/.idea/misc.xml b/SwichGIT/ServerPyt/.idea/misc.xml deleted file mode 100644 index d1e22ec..0000000 --- a/SwichGIT/ServerPyt/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/SwichGIT/ServerPyt/.idea/modules.xml b/SwichGIT/ServerPyt/.idea/modules.xml deleted file mode 100644 index e5fbddf..0000000 --- a/SwichGIT/ServerPyt/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/SwichGIT/ServerPyt/.idea/vcs.xml b/SwichGIT/ServerPyt/.idea/vcs.xml deleted file mode 100644 index 6c0b863..0000000 --- a/SwichGIT/ServerPyt/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/SwichGIT/ServerPyt/.idea/workspace.xml b/SwichGIT/ServerPyt/.idea/workspace.xml deleted file mode 100644 index b52d1c3..0000000 --- a/SwichGIT/ServerPyt/.idea/workspace.xml +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - - - -