1: /*
2: * Copyright (c) 1980 Regents of the University of California.
3: * All rights reserved. The Berkeley software License Agreement
4: * specifies the terms and conditions for redistribution.
5: *
6: * @(#)deck.h 5.1 (Berkeley) 5/30/85
7: */
8:
9: /*
10: * define structure of a deck of cards and other related things
11: */
12:
13:
14: #define CARDS 52 /* number cards in deck */
15: #define RANKS 13 /* number ranks in deck */
16: #define SUITS 4 /* number suits in deck */
17:
18: #define CINHAND 4 /* # cards in cribbage hand */
19: #define FULLHAND 6 /* # cards in dealt hand */
20:
21: #define LGAME 121 /* number points in a game */
22: #define SGAME 61 /* # points in a short game */
23:
24: #define SPADES 0 /* value of each suit */
25: #define HEARTS 1
26: #define DIAMONDS 2
27: #define CLUBS 3
28:
29: #define ACE 0 /* value of each rank */
30: #define TWO 1
31: #define THREE 2
32: #define FOUR 3
33: #define FIVE 4
34: #define SIX 5
35: #define SEVEN 6
36: #define EIGHT 7
37: #define NINE 8
38: #define TEN 9
39: #define JACK 10
40: #define QUEEN 11
41: #define KING 12
42: #define EMPTY 13
43:
44: #define VAL(c) ( (c) < 9 ? (c)+1 : 10 ) /* val of rank */
45:
46:
47: #ifndef TRUE
48: # define TRUE 1
49: # define FALSE 0
50: #endif
51:
52: typedef struct {
53: int rank;
54: int suit;
55: } CARD;
56:
57: typedef char BOOLEAN;
Defined typedef's
BOOLEAN
defined in line
57; used 26 times
- in /usr/src/games/cribbage/crib.c line
33,
157-158(2),
248,
303,
331-335(2),
374,
405,
412,
566
- in /usr/src/games/cribbage/io.c line
56,
73,
98,
111,
136,
219
- in /usr/src/games/cribbage/score.c line
79-85(3),
203,
276
- in /usr/src/games/cribbage/support.c line
93,
148,
169,
208
Defined macros
ACE
defined in line
29;
never used
CARDS
defined in line
14; used 14 times
CLUBS
defined in line
27;
never used
EIGHT
defined in line
36;
never used
EMPTY
defined in line
42; used 15 times
FALSE
defined in line
49; used 47 times
- in /usr/src/games/cribbage/cards.c line
89
- in /usr/src/games/cribbage/crib.c line
46,
79,
177-180(2),
223,
260,
270,
313-318(2),
335,
346,
357,
365,
421-425(2),
441,
465,
487-492(2),
499,
523-530(3),
546,
556,
586
- in /usr/src/games/cribbage/extern.c line
15-18(4)
- in /usr/src/games/cribbage/io.c line
61(2),
76,
221
- in /usr/src/games/cribbage/score.c line
254,
290
- in /usr/src/games/cribbage/support.c line
96,
131-132(2),
232,
262
- in /usr/src/games/cribbage/test.c line
70-71(3),
92,
116
FIVE
defined in line
33;
never used
FOUR
defined in line
32;
never used
JACK
defined in line
39; used 3 times
KING
defined in line
41;
never used
LGAME
defined in line
21; used 3 times
NINE
defined in line
37;
never used
QUEEN
defined in line
40;
never used
RANKS
defined in line
15; used 11 times
SEVEN
defined in line
35;
never used
SGAME
defined in line
22; used 3 times
SIX
defined in line
34;
never used
SUITS
defined in line
16; used 5 times
TEN
defined in line
38;
never used
THREE
defined in line
31;
never used
TRUE
defined in line
48; used 52 times
- in line 47
- in /usr/src/games/cribbage/cards.c line
87
- in /usr/src/games/cribbage/crib.c line
50-56(3),
76-78(3),
94,
165,
203,
238,
263-269(3),
308,
424-426(2),
432,
439,
446,
468,
477,
485,
514,
531,
538,
544,
571-584(6)
- in /usr/src/games/cribbage/io.c line
59(2),
87,
247,
275
- in /usr/src/games/cribbage/score.c line
90,
205,
245,
291-295(2)
- in /usr/src/games/cribbage/support.c line
232
- in /usr/src/games/cribbage/test.c line
71,
92,
104(2),
116,
128(2)
TWO
defined in line
30;
never used
VAL
defined in line
44; used 11 times
Usage of this include