void openPack (card pack [52]) { /* Description.... This function initialises a pack in the following order: Ace to King in suit order Hearts, Clubs, Diamonds, Spades */ /* for each of 52 cards (0 - 51) { Copy card name to card record's 'face' field Copy suit name to card record's 'suit' field if loop counter % 13 <= 9 set card's points field to loop counter % 13 + 1 else set card's points field to 10 } */ int counter ; for (counter = 0; counter <=51; counter ++) { strcpy (pack [counter].face, faces [counter % 13]) ; strcpy (pack [counter].suit, suits [counter / 13]) ; if (counter % 13 <= 9) pack [counter].points = counter % 13 + 1 ; else pack [counter].points = 10 ; } } void shuffle (card pack [52]) { /* Description.... This function takes the sorted pack of cards and jumbles them up */ /* for each of 52 cards { pick a card at random set temp = this card set this card = another randomly chosen card set that randomly chosen card = temp } */ int counter, randomcard ; card temp ; } void deal (card pack [52], card playersHand [5], card dealersHand [5]) { /* Description...... This function deals five cards each to the player and the dealer */ /* set counter = 0 ; for card number goes from 0 to 4 { copy points value from pack[counter] to playersHand [counter] copy face value ... copy suit value ... Add 1 to counter copy points value from pack[counter] to dealersHand [counter] copy face value ... copy suit value ... Add 1 to counter } */ int counter, cardNumber ; } void displayCard (card theCard) { /* Description...... This function displays the name and suit of a card */ /* Display theCard's face name and suit */ } int rollDice (int *die1, int *die2) { /* Description...... This function rolls the two dice, sets the two arguments equal to the two throws and returns the sum of the throw */ /* Set die1 = random number between 1 and 7 Set die2 = random number between 1 and 7 return die1 + die2 */ } void clearClient (int x, int y1, int y2) { /* This function clears an area of screen between x,y1 and x,y2 */ int counter ; for (counter = y1; counter <= y2; counter ++) { gotoxy (x, counter) ; clreol () ; } } int handValue (card hand [5]) { /* This function calculates the value of the cards in a hand of 5 cards */ int total = 0, counter ; for (counter = 1; counter <= 4; counter ++) total += hand [counter].points ; return total ; } r