Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
Coursera Learner committed Mar 7, 2024
1 parent 5db216a commit da11279
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions c3prj1_deck/deck.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ deck_t * make_deck_exclude(deck_t * excluded_cards){
return deck_exclude;
}
deck_t * build_remaining_deck(deck_t ** hands, size_t n_hands){
deck_t excluded = malloc(sizeof(*excluded));
deck_t * excluded = malloc(sizeof(*excluded));
excluded->cards = NULL;
excluded->n_cards = 0;
deck_t *hand;
Expand All @@ -100,7 +100,7 @@ deck_t * build_remaining_deck(deck_t ** hands, size_t n_hands){
for(int j=0;j<hand->n_cards;j++){
card = hand->cards[j];
if(card->value !=0){
if(!deck_contains(deck,*card)){
if(deck_contains(excluded,*card)==0){
add_card_to(excluded, *card);
}
}
Expand Down

0 comments on commit da11279

Please sign in to comment.