Added function to deal the cards when the game starts.

This commit is contained in:
Murilo Soares Pereira 2010-04-10 00:56:44 -03:00
parent d7f349a82c
commit 2cd63146ca
2 changed files with 47 additions and 0 deletions

View File

@ -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;
}

View File

@ -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