CSC 101 Lecture Notes Week 10
Review of Topics from Weeks 8 and 9;
Review of the Final Exam
// // Constant definitions // const int DECK_SIZE = 52; // Number of cards in a deck const int CARD_STR_LEN = 4; // Number of chars in a card string const int MAX_HAND_SIZE = 20; // Maximum number of cards in any hand const int SUIT_POSITION = 2; // Position of the suit char in a card const int MAX_SHUFFLES = 10; // Maximum number of times to test shuffle const char BLANK_CARD[] = " "; // A blank card in a deck or hand const int MAX_INSTR_LINES = 500; // Max number of lines in instructions file const int MAX_INSTR_COLS = 80; // Max number of columns in instructions file
//
// Type Deck is an array of char strings. It represents the card deck used in
// game play.
//
typedef char Deck[DECK_SIZE][CARD_STR_LEN];
// ^^^^^^^^^ ^^^^^^^^^^^^
// ^^^^^^^^^ ^^^^^^^^^^^^ CARD_STR_LEN is the size of each
// ^^^^^^^^^ array element (a card string)
// ^^^^^^^^^
// ^^^^^^^^^ DECK_SIZE is the size of the deck array
void Shuffle(
Deck unshuffled_deck, // Unshuffled input deck
Deck shuffled_deck // Shuffled output deck
);