|
1 | 1 | // carddeck_2b.c
|
2 | 2 | // Chapter 16
|
3 |
| -// <book title> |
| 3 | +// Learn C Programming |
4 | 4 | //
|
5 |
| -// carddeck_2a.c builds upon carddeck_1a.c. |
| 5 | +// carddeck_2b.c builds upon carddeck_2a.c. |
6 | 6 | // In this version, we add the hand structure using
|
7 | 7 | // individual pointer variables to Cards.
|
8 | 8 | //
|
9 |
| -// compile with cc carddeck_2b.c -o carddeck_2b -Wall -Werror -std-c11 |
| 9 | +// compile with |
| 10 | +// |
| 11 | +// cc carddeck_2b.c -o carddeck_2b -Wall -Werror -std-c11 |
10 | 12 | //
|
11 | 13 |
|
12 | 14 |
|
|
20 | 22 | // of literals; when you need to change these, they are applied
|
21 | 23 | // everywhere.
|
22 | 24 | //
|
23 |
| -const int kCardsInDeck = 52; // For now, 52 cards in a deck. This will change |
24 |
| - // depending upon the card game and the # of wild |
25 |
| - // cards, etc. |
26 |
| -const int kCardsInSuit = 13; // For now, kCardsInDeck / 4. This will change |
27 |
| - // depending upon the card game. |
28 |
| -const int kCardsInHand = 5; // For now, 5 cards dealt for each hange. This will |
29 |
| - // change depending upon the card game. |
30 |
| -const int kNumHands = 4; // For now, for hands per "table". This will change |
31 |
| - // depending on the game we want to implement. |
| 25 | +enum { |
| 26 | + kCardsInDeck = 52, // For now, 52 cards in a deck. This will change |
| 27 | + // depending upon the card game and the # of wild |
| 28 | + // cards, etc. |
| 29 | + kCardsInSuit = 13, // For now, kCardsInDeck / 4. This will change |
| 30 | + // depending upon the card game. |
| 31 | + kCardsInHand = 5, // For now, 5 cards dealt for each hange. This will |
| 32 | + // change depending upon the card game. |
| 33 | + kNumHands = 4 // For now, for hands per "table". This will change |
| 34 | + // depending on the game we want to implement. |
| 35 | +}; |
32 | 36 |
|
33 | 37 | const bool kWildCard = true;
|
34 | 38 | const bool kNotWildCard = false;
|
|
0 commit comments