fix end of game
continuous-integration/drone/push Build is passing Details

master
Bastien JACQUELIN 2 years ago
parent 12416b979a
commit 11fcaadbef

@ -30,7 +30,7 @@ class Deck {
createDeck(nbCards) {//toTest⌛when more than 12c to d't add other cards createDeck(nbCards) {//toTest⌛when more than 12c to d't add other cards
if (this.remainingCards.length < this.nbCards) {// no more cards if (this.remainingCards.length < this.nbCards) {// no more cards
console.log("PLUS DE CARTES"); console.log("PLUS DE CARTES");
return; return 2;
} }
else { else {
let nbSets = setsCounter(this.outputCards, this.nbCards); let nbSets = setsCounter(this.outputCards, this.nbCards);
@ -76,8 +76,7 @@ class Deck {
return 2; return 2;
} }
else { else {
this.removeFromoutputCards(selectedCards); return this.removeFromoutputCards(selectedCards);
return 1;
} }
} }
else if (this.remainingCards.length < this.nbCards) { else if (this.remainingCards.length < this.nbCards) {
@ -109,7 +108,7 @@ class Deck {
} }
else { else {
this.setMade.push(set); this.setMade.push(set);
this.createDeck(this.nbCards) return this.createDeck(this.nbCards)
} }
} }
} }

Loading…
Cancel
Save