Commit | Line | Data |
---|---|---|
6cca9b39 KM |
1 | /* |
2 | * Copyright (c) 1980 Regents of the University of California. | |
bf870064 | 3 | * All rights reserved. |
6cca9b39 | 4 | * |
bf870064 KB |
5 | * Redistribution and use in source and binary forms are permitted |
6 | * provided that this notice is preserved and that due credit is given | |
7 | * to the University of California at Berkeley. The name of the University | |
8 | * may not be used to endorse or promote products derived from this | |
9 | * software without specific prior written permission. This software | |
10 | * is provided ``as is'' without express or implied warranty. | |
11 | * | |
12 | * @(#)deck.h 5.2 (Berkeley) %G% | |
6cca9b39 | 13 | */ |
bb5242bf KA |
14 | |
15 | /* | |
16 | * define structure of a deck of cards and other related things | |
17 | */ | |
18 | ||
19 | ||
20 | #define CARDS 52 /* number cards in deck */ | |
21 | #define RANKS 13 /* number ranks in deck */ | |
22 | #define SUITS 4 /* number suits in deck */ | |
23 | ||
24 | #define CINHAND 4 /* # cards in cribbage hand */ | |
25 | #define FULLHAND 6 /* # cards in dealt hand */ | |
26 | ||
27 | #define LGAME 121 /* number points in a game */ | |
28 | #define SGAME 61 /* # points in a short game */ | |
29 | ||
30 | #define SPADES 0 /* value of each suit */ | |
31 | #define HEARTS 1 | |
32 | #define DIAMONDS 2 | |
33 | #define CLUBS 3 | |
34 | ||
35 | #define ACE 0 /* value of each rank */ | |
36 | #define TWO 1 | |
37 | #define THREE 2 | |
38 | #define FOUR 3 | |
39 | #define FIVE 4 | |
40 | #define SIX 5 | |
41 | #define SEVEN 6 | |
42 | #define EIGHT 7 | |
43 | #define NINE 8 | |
44 | #define TEN 9 | |
45 | #define JACK 10 | |
46 | #define QUEEN 11 | |
47 | #define KING 12 | |
5836528f | 48 | #define EMPTY 13 |
bb5242bf KA |
49 | |
50 | #define VAL(c) ( (c) < 9 ? (c)+1 : 10 ) /* val of rank */ | |
51 | ||
52 | ||
5836528f KA |
53 | #ifndef TRUE |
54 | # define TRUE 1 | |
55 | # define FALSE 0 | |
56 | #endif | |
bb5242bf KA |
57 | |
58 | typedef struct { | |
59 | int rank; | |
60 | int suit; | |
61 | } CARD; | |
62 | ||
63 | typedef char BOOLEAN; | |
64 |