Ajout du calcul de performances
continuous-integration/drone/push Build is passing Details

RaphouBranche
Raphael LACOTE 2 years ago
parent 90de25cc81
commit e2b718624c

@ -11,7 +11,7 @@ class Deck {
this.remainingCards = this.remainingCards.concat(this.allCards);// cards in the stack, init = all before creation of deck -> remove this.remainingCards = this.remainingCards.concat(this.allCards);// cards in the stack, init = all before creation of deck -> remove
this.outputCards = [];// 12 cards lay on the table this.outputCards = [];// 12 cards lay on the table
this.setMade = [];// array of array with all the set already mades (array of set) this.setMade = [];// array of array with all the set already mades (array of set)
this.createDeck(12); this.createDeck(48);
} }
/** /**
* *

@ -253,9 +253,7 @@ function numberOfHyperset2(deck) {
for (j = i + 1; j < deck.length - 2; j++) { for (j = i + 1; j < deck.length - 2; j++) {
for (k = j + 1; k < deck.length - 1; k++) { for (k = j + 1; k < deck.length - 1; k++) {
for (lapin = k + 1; lapin < deck.length; lapin++) { for (lapin = k + 1; lapin < deck.length; lapin++) {
console.log(" i,j,k,l :", i, j, k, lapin)
if (isHyperset([deck[i], deck[j]], [deck[k], deck[lapin]])) { if (isHyperset([deck[i], deck[j]], [deck[k], deck[lapin]])) {
console.log(deck[i],deck[j],deck[k],deck[lapin])
res += 1 res += 1
} }
} }

@ -0,0 +1,34 @@
console.log('Debut de l\'execution');
/*setTimeout(function () {
let fin = new Date().getTime();
let tempsEcoule = fin - debut;
console.log("Temps ecoulé : " + tempsEcoule + " millisecondes");
}, 5000);
*/
let ite = 0;
let cpt=0
while (ite < 5) {
let deck = new Deck([0, 1, 2, 3], 4);
let debut = new Date().getTime()
numberOfSets3(deck.outputCards)
//numberOfHyperset2(deck.outputCards)
let fin = new Date().getTime()
let tempsEcoule = fin - debut
console.log("Temps ecoule : " + tempsEcoule + " millisecondes")
cpt = cpt + tempsEcoule
ite=ite+1
}
console.log(cpt/5)
Loading…
Cancel
Save