Commit 6117d857 authored by Chingiz's avatar Chingiz 💻

Made some changes in the Card and Deck classes

parent fbd9b108
export class Card {
private _rank: string;
private _suite: string;
constructor(rank: string, suit: string) {
this._rank = rank;
this._suite = suit;
}
show(){
return(` _____\n| ${this._rank} ${this._suite} |\n -----`)
}
......
......@@ -21,12 +21,12 @@ export class Deck {
[this._cards[i], this._cards[j]] = [this._cards[j], this._cards[i]];
}
}
takeACard(){
takeACardFromDeck(){
const ranNum: number = getRandomNumber(0, this._cards.length + 1);
if(!this.tookedCardIndexes.includes(ranNum)){
return this._cards[ranNum];
this.tookedCardIndexes.push(ranNum);
}
this.takeACard();
this.takeACardFromDeck();
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment