From f718468dded73001b149cee56309d7c31fed8498 Mon Sep 17 00:00:00 2001 From: "aurian.jault" Date: Fri, 3 Feb 2023 13:36:29 +0100 Subject: [PATCH 01/18] Supr de mon index grave style alors que bastien fais un dossier console pour test????? --- src/index.html | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 src/index.html diff --git a/src/index.html b/src/index.html deleted file mode 100644 index b32303c..0000000 --- a/src/index.html +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - My awesome blog - - - -

My awesome blog

- - - - - - - - \ No newline at end of file From 8a178e7720b97927fbb2bc6c02f8a1f740f62777 Mon Sep 17 00:00:00 2001 From: "aurian.jault" Date: Sun, 5 Feb 2023 19:21:40 +0100 Subject: [PATCH 02/18] Algo de calcul des Set dans un deck --- src/Console/Console.html | 24 --------- src/algo.js | 113 ++++++++++++++++++++------------------- src/index.html | 24 +++++++++ 3 files changed, 82 insertions(+), 79 deletions(-) delete mode 100644 src/Console/Console.html create mode 100644 src/index.html diff --git a/src/Console/Console.html b/src/Console/Console.html deleted file mode 100644 index 1f6b5c3..0000000 --- a/src/Console/Console.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - Console - - - -

Console - test

- -
- -
- - - - - - - - - \ No newline at end of file diff --git a/src/algo.js b/src/algo.js index c4e8740..3c256d9 100644 --- a/src/algo.js +++ b/src/algo.js @@ -1,58 +1,3 @@ -// Pseudo code -// -/* - * function checkReslt(array ) - * { - * new array> matrice = vide - * - * forEach(array: value) - * { - * matrice.add(value.getAttrib) - * } - * Check all length of matrice - * for(i = 0; i tab - * for (j=0; j + + + + + + Console + + + +

Console - test

+ +
+ +
+ + + + + + + + + From a86c5e029251ad85c6096866e779b975cb774467 Mon Sep 17 00:00:00 2001 From: RemRem et ToTo Date: Tue, 7 Feb 2023 14:25:41 +0100 Subject: [PATCH 03/18] Update '.drone.yml' --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index a8d87da..d306405 100644 --- a/.drone.yml +++ b/.drone.yml @@ -27,5 +27,5 @@ steps: CONTAINERNAME: hyperset COMMAND: create OVERWRITE: true - ADMINS: aurian.jault + ADMINS: aurianjault depends_on : [hyperset-build] \ No newline at end of file From 41fdb068e29be1407c24715213fc9651c96600cc Mon Sep 17 00:00:00 2001 From: RemRem et ToTo Date: Tue, 7 Feb 2023 14:26:35 +0100 Subject: [PATCH 04/18] Update '.drone.yml' --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index d306405..738d5e9 100644 --- a/.drone.yml +++ b/.drone.yml @@ -28,4 +28,4 @@ steps: COMMAND: create OVERWRITE: true ADMINS: aurianjault - depends_on : [hyperset-build] \ No newline at end of file + depends_on : [hyperset-build] \ No newline at end of file From 1931586d267f3676c726ebe30d992bb4ebae129d Mon Sep 17 00:00:00 2001 From: RemRem et ToTo Date: Tue, 7 Feb 2023 14:28:55 +0100 Subject: [PATCH 05/18] Update '.drone.yml' --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 738d5e9..dc1207c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -27,5 +27,5 @@ steps: CONTAINERNAME: hyperset COMMAND: create OVERWRITE: true - ADMINS: aurianjault + ADMINS: aurianjault,raphaellacote,bastienjacquelin,remiarnal depends_on : [hyperset-build] \ No newline at end of file From e94e919bebc1bb97434de8a56c1575fba23e1a8d Mon Sep 17 00:00:00 2001 From: RemRem Date: Tue, 7 Feb 2023 14:47:08 +0100 Subject: [PATCH 06/18] create test dir --- test/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test/.gitkeep diff --git a/test/.gitkeep b/test/.gitkeep new file mode 100644 index 0000000..e69de29 From 0a13894bc2836be8cfcbc2c0a5675d0924d2f432 Mon Sep 17 00:00:00 2001 From: Bastien Jacquelin Date: Tue, 7 Feb 2023 16:12:02 +0100 Subject: [PATCH 07/18] remove the card from the output, need to fix createdeck too much card added --- src/Console/main.js | 14 ++++++++++---- src/Model/Deck.js | 26 +++++++++++++++++++------- src/Model/Factory.js | 22 ++++++++++++++++++++-- 3 files changed, 49 insertions(+), 13 deletions(-) diff --git a/src/Console/main.js b/src/Console/main.js index 2668f88..6832fb1 100644 --- a/src/Console/main.js +++ b/src/Console/main.js @@ -30,8 +30,10 @@ try { console.groupEnd(); +// CREATE DECK + console.group('Deck'); -let deck = new Deck([0,1,2,3]); +let deck = new Deck([0,1,2,3],3); console.log(`All cards : ${deck.allCards.length}`); //Display all cards console.log(`All cards display`); @@ -54,23 +56,27 @@ console.log(`set already made ${deck.setMade}`); // console.log(e.color,e.number,e.shape,e.filling); // }); + +// CHECK SET +console.log("CHECKING SET") + console.log("Card to remove: ") console.log(deck.outputCards[0].getAttributes(),deck.outputCards[1].getAttributes(),deck.outputCards[2].getAttributes()) let customCard=[deck.outputCards[0],deck.outputCards[1],deck.outputCards[2]]; deck.checkSet(customCard); console.log(`remaining cards : ${deck.remainingCards.length}`) console.log(`All cards : ${deck.allCards.length}`) - console.log(`remaining cards : ${deck.remainingCards.length}`) // deck.remainingCards.forEach(e => { // console.log(e.getAttributes()); // }); - console.log(`size output ${deck.outputCards.length}`); -console.log(`Output cards`); +console.group('Output cards'); deck.outputCards.forEach(e => { console.log(e.getAttributes()); }); +console.log(`nbCards : ${deck.nbCards}`); +console.groupEnd(); //let deck5 = new Deck([0,1,2,3,4]); diff --git a/src/Model/Deck.js b/src/Model/Deck.js index 57e9d23..3ec6507 100644 --- a/src/Model/Deck.js +++ b/src/Model/Deck.js @@ -2,21 +2,24 @@ class Deck{ /** * * @param {*} attributes : array with the attributes index for the cards + * @author Bastien Jacquelin */ - constructor(attributes){ + constructor(attributes,nbCards){ //console.log(attributes); this.allCards=this.createCards(attributes);// All the cards in the game this.remainingCards=[] + this.nbCards=nbCards; this.remainingCards=this.remainingCards.concat(this.allCards);// cards in the stack this.outputCards=[];// 12 cards lay on the table this.setMade=[];// array with all the set already mades (array of set) - this.createDeck(); + this.createDeck(12); } /** - * @brief creation of the deck : call factory to create the good cards + * @brief creation of the deck : 12 cards lay in front of the player + * @author Bastien Jacquelin */ - createDeck(){ - for (let i=0; i<12; i++){ + createDeck(nbCards){ + for (let i=0; i { @@ -47,8 +57,9 @@ class Deck{ } } /** - * - * @param {*} selectedCards wehn a set is made, need to remove the card from the array remainingCards + * @brief when a set is made, need to remove the card from the array remainingCards + * @param {*} selectedCards cards which need to be removed from the outputcards + * @author Bastien Jacquelin */ removeFromoutputCards(selectedCards){//better check of card type more opti let set=[]; @@ -65,6 +76,7 @@ class Deck{ } else{ this.setMade.push(set); + this.createDeck(this.nbCards) } } } \ No newline at end of file diff --git a/src/Model/Factory.js b/src/Model/Factory.js index 4e2aa5b..181aa59 100644 --- a/src/Model/Factory.js +++ b/src/Model/Factory.js @@ -3,6 +3,12 @@ class Factory{ let length=arrayOfAttributes.length this.product=this.concreteCardCreation(arrayOfAttributes,length); } + /** + * @brief check if i in arrayOfAttributes + * @param {*} i value + * @param {*} arrayOfAttributes array + * @returns boolean + */ inArray(i,arrayOfAttributes){ let finded=false; for (let j=0;j Date: Tue, 7 Feb 2023 17:29:12 +0100 Subject: [PATCH 08/18] fix issue : adding 3 new card to the deck : Working --- src/Console/main.js | 17 +++++++++++------ src/Model/Deck.js | 22 +++++++++++----------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/Console/main.js b/src/Console/main.js index 6832fb1..0d00811 100644 --- a/src/Console/main.js +++ b/src/Console/main.js @@ -47,14 +47,15 @@ console.log(`remaining cards : ${deck.remainingCards.length}`) // console.log(e.getAttributes()); // }); console.log(`size output ${deck.outputCards.length}`); -console.log(`Output cards`); +console.group('Output cards'); deck.outputCards.forEach(e => { console.log(e.getAttributes()); }); +console.groupEnd(); console.log(`set already made ${deck.setMade}`); -// deck.setMade.forEach(e => { -// console.log(e.color,e.number,e.shape,e.filling); -// }); +deck.setMade.forEach(e => { + console.log(e.color,e.number,e.shape,e.filling); + }); // CHECK SET @@ -66,7 +67,6 @@ let customCard=[deck.outputCards[0],deck.outputCards[1],deck.outputCards[2]]; deck.checkSet(customCard); console.log(`remaining cards : ${deck.remainingCards.length}`) console.log(`All cards : ${deck.allCards.length}`) -console.log(`remaining cards : ${deck.remainingCards.length}`) // deck.remainingCards.forEach(e => { // console.log(e.getAttributes()); // }); @@ -75,9 +75,14 @@ console.group('Output cards'); deck.outputCards.forEach(e => { console.log(e.getAttributes()); }); -console.log(`nbCards : ${deck.nbCards}`); console.groupEnd(); +console.group('set made'); +console.log(`set already made : ${deck.setMade.length}`); +deck.setMade.forEach(e => { + console.log(e.color,e.number,e.shape,e.filling); + }); + console.groupEnd(); //let deck5 = new Deck([0,1,2,3,4]); //console.log(`All cards with 5 attributes size ${deck5.allCards.length}`); diff --git a/src/Model/Deck.js b/src/Model/Deck.js index 3ec6507..03fe67f 100644 --- a/src/Model/Deck.js +++ b/src/Model/Deck.js @@ -51,9 +51,7 @@ class Deck{ */ checkSet(selectedCards){ if(true){//isSet(selectedCards)){ - selectedCards.forEach(e => { - this.removeFromoutputCards(e); - }); + this.removeFromoutputCards(selectedCards); } } /** @@ -63,15 +61,17 @@ class Deck{ */ removeFromoutputCards(selectedCards){//better check of card type more opti let set=[]; - for(let i=0; i { + for(let i=0; i Date: Sat, 11 Feb 2023 11:48:30 +0100 Subject: [PATCH 09/18] :stethoscope: add sonarqube ci --- .drone.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index dc1207c..cefe0da 100644 --- a/.drone.yml +++ b/.drone.yml @@ -28,4 +28,12 @@ steps: COMMAND: create OVERWRITE: true ADMINS: aurianjault,raphaellacote,bastienjacquelin,remiarnal - depends_on : [hyperset-build] \ No newline at end of file + depends_on : [hyperset-build] + + - name: code-analysis + environment: + SONAR_TOKEN: + from_secret: SONAR_TOKEN + commands: + - sonar-scanner -Dsonar.projectKey=hyperset -Dsonar.sources=. -Dsonar.host.url=https://codefirst.iut.uca.fr/sonar + depends_on: [ hyperset-build ] \ No newline at end of file From 6145f743b73cd538938e75f96ee6eb89a606818e Mon Sep 17 00:00:00 2001 From: RemRem et ToTo Date: Sat, 11 Feb 2023 11:52:53 +0100 Subject: [PATCH 10/18] :green_heart: fix sonarqube --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index cefe0da..e03de0a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -35,5 +35,5 @@ steps: SONAR_TOKEN: from_secret: SONAR_TOKEN commands: - - sonar-scanner -Dsonar.projectKey=hyperset -Dsonar.sources=. -Dsonar.host.url=https://codefirst.iut.uca.fr/sonar + - sonar-scanner -Dsonar.projectKey=hyperset -Dsonar.sources=. -Dsonar.host.url=https://codefirst.iut.uca.fr/sonar -Dsonar.login=$${SONAR_TOKEN} depends_on: [ hyperset-build ] \ No newline at end of file From 9177b35b5b8053c3024850541edaeb8bb522f64e Mon Sep 17 00:00:00 2001 From: RemRem et ToTo Date: Sat, 11 Feb 2023 11:59:00 +0100 Subject: [PATCH 11/18] idk waid --- .drone.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.drone.yml b/.drone.yml index e03de0a..b80e216 100644 --- a/.drone.yml +++ b/.drone.yml @@ -31,6 +31,7 @@ steps: depends_on : [hyperset-build] - name: code-analysis + image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest environment: SONAR_TOKEN: from_secret: SONAR_TOKEN From ed34f5a4a283f1f7955cb9a8e55680295cf94e0d Mon Sep 17 00:00:00 2001 From: RemRem et ToTo Date: Sat, 11 Feb 2023 12:02:09 +0100 Subject: [PATCH 12/18] Update '.drone.yml' --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index b80e216..2094717 100644 --- a/.drone.yml +++ b/.drone.yml @@ -31,7 +31,7 @@ steps: depends_on : [hyperset-build] - name: code-analysis - image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest + image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-sonar:latest environment: SONAR_TOKEN: from_secret: SONAR_TOKEN From 537e95b75d4b5cab3aede9886e04a29627f1c8f3 Mon Sep 17 00:00:00 2001 From: RemRem et ToTo Date: Sat, 11 Feb 2023 12:06:18 +0100 Subject: [PATCH 13/18] Update '.drone.yml' --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 2094717..f5eb1de 100644 --- a/.drone.yml +++ b/.drone.yml @@ -36,5 +36,5 @@ steps: SONAR_TOKEN: from_secret: SONAR_TOKEN commands: - - sonar-scanner -Dsonar.projectKey=hyperset -Dsonar.sources=. -Dsonar.host.url=https://codefirst.iut.uca.fr/sonar -Dsonar.login=$${SONAR_TOKEN} + - sonarscanner -Dsonar.projectKey=hyperset -Dsonar.sources=. -Dsonar.host.url=https://codefirst.iut.uca.fr/sonar -Dsonar.login=$${SONAR_TOKEN} depends_on: [ hyperset-build ] \ No newline at end of file From 929f54fa36a72ad8842a4e65a230e827a03f71d6 Mon Sep 17 00:00:00 2001 From: "aurian.jault" Date: Tue, 14 Feb 2023 14:00:25 +0100 Subject: [PATCH 14/18] ALGO QUI MARCHE TOUJOURS PAS --- src/algo.js | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/src/algo.js b/src/algo.js index 3c256d9..500b282 100644 --- a/src/algo.js +++ b/src/algo.js @@ -1,7 +1,10 @@ +import('./Model/Card.js') + + function isSet(cards) { let attributesMatrix = []; - + cards.forEach(element => { attributesMatrix.push(element.getAttributes()); }); @@ -61,38 +64,51 @@ function nbrSets(deck, setSize){ matrix = [] // Remplie la matrice des valeurs du deck for (i=0;i Date: Sat, 18 Feb 2023 15:00:58 +0100 Subject: [PATCH 15/18] Update '.drone.yml' --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index f5eb1de..763ebc4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -31,7 +31,7 @@ steps: depends_on : [hyperset-build] - name: code-analysis - image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-sonar:latest + image: sonarsource/sonar-scanner-cli environment: SONAR_TOKEN: from_secret: SONAR_TOKEN From 226c456ee1026cb0a2e3e1ba530ce65ac14db4f8 Mon Sep 17 00:00:00 2001 From: RemRem et ToTo Date: Sat, 18 Feb 2023 15:01:36 +0100 Subject: [PATCH 16/18] Update '.drone.yml' --- .drone.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 763ebc4..d365e34 100644 --- a/.drone.yml +++ b/.drone.yml @@ -36,5 +36,5 @@ steps: SONAR_TOKEN: from_secret: SONAR_TOKEN commands: - - sonarscanner -Dsonar.projectKey=hyperset -Dsonar.sources=. -Dsonar.host.url=https://codefirst.iut.uca.fr/sonar -Dsonar.login=$${SONAR_TOKEN} + - sonar-scanner -Dsonar.projectKey=hyperset -Dsonar.sources=. -Dsonar.host.url=https://codefirst.iut.uca.fr/sonar -Dsonar.login=$${SONAR_TOKEN} depends_on: [ hyperset-build ] \ No newline at end of file From c1cfe99118ddb3e712a3a8e5fb66cfbcba7e4636 Mon Sep 17 00:00:00 2001 From: "aurian.jault" Date: Sun, 19 Feb 2023 21:43:20 +0100 Subject: [PATCH 17/18] abandon de l algo commun pour tous les set possibles et creation des algo pour chaques configuration --- src/algo.js | 111 +++++++++++++++++++++++++--------------------------- 1 file changed, 54 insertions(+), 57 deletions(-) diff --git a/src/algo.js b/src/algo.js index 500b282..c3da01b 100644 --- a/src/algo.js +++ b/src/algo.js @@ -59,74 +59,71 @@ function checkAttributes(attributes){ return boolLoop === true; } - -function nbrSets(deck, setSize){ - matrix = [] - // Remplie la matrice des valeurs du deck - for (i=0;i Date: Sun, 19 Feb 2023 21:45:24 +0100 Subject: [PATCH 18/18] supression de l index.html --- src/index.html | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 src/index.html diff --git a/src/index.html b/src/index.html deleted file mode 100644 index e8691d0..0000000 --- a/src/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - Console - - - -

Console - test

- -
- -
- - - - - - - - -