|
|
1.1 root 1: /* @(#)deck.h 1.3 (Berkeley) 5/19/83 */
2:
3: /*
4: * define structure of a deck of cards and other related things
5: */
6:
7:
8: #define CARDS 52 /* number cards in deck */
9: #define RANKS 13 /* number ranks in deck */
10: #define SUITS 4 /* number suits in deck */
11:
12: #define CINHAND 4 /* # cards in cribbage hand */
13: #define FULLHAND 6 /* # cards in dealt hand */
14:
15: #define LGAME 121 /* number points in a game */
16: #define SGAME 61 /* # points in a short game */
17:
18: #define SPADES 0 /* value of each suit */
19: #define HEARTS 1
20: #define DIAMONDS 2
21: #define CLUBS 3
22:
23: #define ACE 0 /* value of each rank */
24: #define TWO 1
25: #define THREE 2
26: #define FOUR 3
27: #define FIVE 4
28: #define SIX 5
29: #define SEVEN 6
30: #define EIGHT 7
31: #define NINE 8
32: #define TEN 9
33: #define JACK 10
34: #define QUEEN 11
35: #define KING 12
36: #define EMPTY 13
37:
38: #define VAL(c) ( (c) < 9 ? (c)+1 : 10 ) /* val of rank */
39:
40:
41: #ifndef TRUE
42: # define TRUE 1
43: # define FALSE 0
44: #endif
45:
46: typedef struct {
47: int rank;
48: int suit;
49: } CARD;
50:
51: typedef char BOOLEAN;
52:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.