edit const
continuous-integration/drone/push Build is passing Details

pull/66/head
Bastien JACQUELIN 2 years ago
parent 515d42739e
commit bb8a27017b

@ -1,8 +1,8 @@
const TAB_COLOR = ['red', 'purple', 'green', 'blue', 'orange'];
const TAB_NUMBER = [1, 2, 3, 4, 5];
const TAB_SHAPE = ['diamond', 'oval', 'squiggle', 'star', 'triangle'];
const TAB_FILLING = ['empty', 'stripped', 'fullO', 'pointed', 'squared'];
const TAB_OUTLINE = ['full', 'dot', 'rect', 'spade', 'sharp'];
const TAB_FILLING = ['empty', 'stripped', 'full', 'pointed', 'squared'];
const TAB_OUTLINE = ['continuous', 'dot', 'rect', 'spade', 'sharp'];
const ATTRIBUTES = [TAB_COLOR, TAB_NUMBER, TAB_SHAPE, TAB_FILLING, TAB_OUTLINE];
const IDX_ATTRIBUTES = ["color", "number", "shape", "filling", "outline"];

@ -33,18 +33,24 @@ class Deck {
return;
}
else {
for (let i = 0; i < nbCards; i++) {
const rand = this.getRandCard();
this.outputCards.push(this.remainingCards[rand]);
this.remainingCards.splice(rand, 1);
}
let nbSets = setsCounter(this.outputCards, this.nbCards);
console.log("nbSets", nbSets);
console.log("outputCards.length", this.outputCards.length);
console.log("remainingCards.length", this.remainingCards.length);
if (nbSets == 0) {
this.createDeck(this.nbCards)
}
let nbSets = setsCounter(this.outputCards, this.nbCards);
if(this.outputCards.length>=12 && nbSets!=0){
return
}
else{
for (let i = 0; i < nbCards; i++) {
const rand = this.getRandCard();
this.outputCards.push(this.remainingCards[rand]);
this.remainingCards.splice(rand, 1);
}
nbSets = setsCounter(this.outputCards, this.nbCards);
console.log("nbSets", nbSets);
// console.log("outputCards.length", this.outputCards.length);
// console.log("remainingCards.length", this.remainingCards.length);
if (nbSets == 0) {
this.createDeck(this.nbCards)
}
}
}
}

Loading…
Cancel
Save