date and time created 82/08/11 16:35:57 by arnold
[unix-history] / usr / src / games / cribbage / deck.h
CommitLineData
bb5242bf
KA
1
2/*
3 * define structure of a deck of cards and other related things
4 */
5
6
7#define CARDS 52 /* number cards in deck */
8#define RANKS 13 /* number ranks in deck */
9#define SUITS 4 /* number suits in deck */
10
11#define CINHAND 4 /* # cards in cribbage hand */
12#define FULLHAND 6 /* # cards in dealt hand */
13
14#define LGAME 121 /* number points in a game */
15#define SGAME 61 /* # points in a short game */
16
17#define SPADES 0 /* value of each suit */
18#define HEARTS 1
19#define DIAMONDS 2
20#define CLUBS 3
21
22#define ACE 0 /* value of each rank */
23#define TWO 1
24#define THREE 2
25#define FOUR 3
26#define FIVE 4
27#define SIX 5
28#define SEVEN 6
29#define EIGHT 7
30#define NINE 8
31#define TEN 9
32#define JACK 10
33#define QUEEN 11
34#define KING 12
35
36#define VAL(c) ( (c) < 9 ? (c)+1 : 10 ) /* val of rank */
37
38
39#define TRUE 1
40#define FALSE 0
41
42typedef struct {
43 int rank;
44 int suit;
45 } CARD;
46
47typedef char BOOLEAN;
48