|
|
|
@ -31,28 +31,46 @@ console.groupEnd();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.group('Deck');
|
|
|
|
|
let deck = new Deck([0,1,3,4]);
|
|
|
|
|
console.log(`All cards with 4 attributes size ${deck.allCards.length}`);
|
|
|
|
|
console.log(`size output ${deck.outputCards.length}`);
|
|
|
|
|
let deck = new Deck([0,1,2,3]);
|
|
|
|
|
console.log(`All cards : ${deck.allCards.length}`);
|
|
|
|
|
//Display all cards
|
|
|
|
|
console.log(`All cards`);
|
|
|
|
|
deck.allCards.forEach(e => {
|
|
|
|
|
//console.log(e.color,e.number,e.shape,e.filling);
|
|
|
|
|
console.log(e.color,e.number,e.filling,e.outline);
|
|
|
|
|
//console.log(e.color,e.number,e.shape,e.outline);
|
|
|
|
|
});
|
|
|
|
|
console.log(`Output cards`);
|
|
|
|
|
// deck.outputCards.forEach(e => {
|
|
|
|
|
console.log(`All cards display`);
|
|
|
|
|
// deck.allCards.forEach(e => {
|
|
|
|
|
// console.log(e.color,e.number,e.shape,e.filling);//no outline
|
|
|
|
|
// //console.log(e.color,e.number,e.filling,e.outline);//no shape
|
|
|
|
|
// //console.log(e.color,e.number,e.shape,e.outline);//no filling
|
|
|
|
|
// });
|
|
|
|
|
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`);
|
|
|
|
|
deck.outputCards.forEach(e => {
|
|
|
|
|
console.log(e.getAttributes());
|
|
|
|
|
});
|
|
|
|
|
console.log(`set already made ${deck.setMade}`);
|
|
|
|
|
console.log(`remaining cards:`);
|
|
|
|
|
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);
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
let customCard=[new Card('red',1,'diamond','stripped')];
|
|
|
|
|
//deck.checkSet(customCard);
|
|
|
|
|
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`);
|
|
|
|
|
deck.outputCards.forEach(e => {
|
|
|
|
|
console.log(e.getAttributes());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//let deck5 = new Deck([0,1,2,3,4]);
|
|
|
|
|