Added function to deal the cards when the game starts.
This commit is contained in:
parent
d7f349a82c
commit
2cd63146ca
46
lib/deck.c
46
lib/deck.c
@ -203,3 +203,49 @@ void shuffle_deck(struct deck *deck) {
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void deal_cards(struct deck *deck) {
|
||||
move_card(&(deck->stock), &(deck->maneuvre_0));
|
||||
expose_card(deck->maneuvre_0->card);
|
||||
move_card(&(deck->stock), &(deck->maneuvre_1));
|
||||
move_card(&(deck->stock), &(deck->maneuvre_2));
|
||||
move_card(&(deck->stock), &(deck->maneuvre_3));
|
||||
move_card(&(deck->stock), &(deck->maneuvre_4));
|
||||
move_card(&(deck->stock), &(deck->maneuvre_5));
|
||||
move_card(&(deck->stock), &(deck->maneuvre_6));
|
||||
|
||||
move_card(&(deck->stock), &(deck->maneuvre_1));
|
||||
expose_card(deck->maneuvre_1->card);
|
||||
move_card(&(deck->stock), &(deck->maneuvre_2));
|
||||
move_card(&(deck->stock), &(deck->maneuvre_3));
|
||||
move_card(&(deck->stock), &(deck->maneuvre_4));
|
||||
move_card(&(deck->stock), &(deck->maneuvre_5));
|
||||
move_card(&(deck->stock), &(deck->maneuvre_6));
|
||||
|
||||
move_card(&(deck->stock), &(deck->maneuvre_2));
|
||||
expose_card(deck->maneuvre_2->card);
|
||||
move_card(&(deck->stock), &(deck->maneuvre_3));
|
||||
move_card(&(deck->stock), &(deck->maneuvre_4));
|
||||
move_card(&(deck->stock), &(deck->maneuvre_5));
|
||||
move_card(&(deck->stock), &(deck->maneuvre_6));
|
||||
|
||||
move_card(&(deck->stock), &(deck->maneuvre_3));
|
||||
expose_card(deck->maneuvre_3->card);
|
||||
move_card(&(deck->stock), &(deck->maneuvre_4));
|
||||
move_card(&(deck->stock), &(deck->maneuvre_5));
|
||||
move_card(&(deck->stock), &(deck->maneuvre_6));
|
||||
|
||||
move_card(&(deck->stock), &(deck->maneuvre_4));
|
||||
expose_card(deck->maneuvre_4->card);
|
||||
move_card(&(deck->stock), &(deck->maneuvre_5));
|
||||
move_card(&(deck->stock), &(deck->maneuvre_6));
|
||||
|
||||
move_card(&(deck->stock), &(deck->maneuvre_5));
|
||||
expose_card(deck->maneuvre_5->card);
|
||||
move_card(&(deck->stock), &(deck->maneuvre_6));
|
||||
|
||||
move_card(&(deck->stock), &(deck->maneuvre_6));
|
||||
expose_card(deck->maneuvre_6->card);
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -56,5 +56,6 @@ void delete_deck(struct deck *);
|
||||
void set_deck_stacks_coordinates(struct deck *);
|
||||
void fill_deck(struct deck *);
|
||||
void shuffle_deck(struct deck *);
|
||||
void deal_cards(struct deck *);
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user