Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void printCard(int card)
- {
- char ranks[RANKS] = {'A','2','3','4','5','6','7','8','9','0','J','Q','K'};
- char *suits = "SHDC";
- printf("%c%c", ranks[card%RANKS], suits[card/RANKS]);
- }
- void displayDeck(int deck[])
- {
- int count = 0;
- int cleanDisplay = 0;
- while(count < MAXIMUM)
- {
- if(cleanDisplay == RANKS)
- {
- printf("n");
- cleanDisplay = 0;
- }
- printCard(deck[count]);
- printf(" ");
- cleanDisplay++;
- count++;
- }
- printf("nn");
- }
- void dealCards(int deck[], int hands, int cards)
- {
- int total = hands * cards;
- int counter = 0;
- int counter2 = 0;
- while(counter < total)
- {
- if(counter2 == cards)
- {
- printf("nPlayer's Hand: n");
- counter2 = 0;
- }
- displayDeck(deck[counter]);
- counter2++;
- counter++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement