1 /* 2 * Copyright (c) 1980, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * %sccs.include.redist.c% 6 * 7 * @(#)deck.h 8.1 (Berkeley) 05/31/93 8 */ 9 10 /* 11 * define structure of a deck of cards and other related things 12 */ 13 14 15 #define CARDS 52 /* number cards in deck */ 16 #define RANKS 13 /* number ranks in deck */ 17 #define SUITS 4 /* number suits in deck */ 18 19 #define CINHAND 4 /* # cards in cribbage hand */ 20 #define FULLHAND 6 /* # cards in dealt hand */ 21 22 #define LGAME 121 /* number points in a game */ 23 #define SGAME 61 /* # points in a short game */ 24 25 #define SPADES 0 /* value of each suit */ 26 #define HEARTS 1 27 #define DIAMONDS 2 28 #define CLUBS 3 29 30 #define ACE 0 /* value of each rank */ 31 #define TWO 1 32 #define THREE 2 33 #define FOUR 3 34 #define FIVE 4 35 #define SIX 5 36 #define SEVEN 6 37 #define EIGHT 7 38 #define NINE 8 39 #define TEN 9 40 #define JACK 10 41 #define QUEEN 11 42 #define KING 12 43 #define EMPTY 13 44 45 #define VAL(c) ( (c) < 9 ? (c)+1 : 10 ) /* val of rank */ 46 47 48 #ifndef TRUE 49 # define TRUE 1 50 # define FALSE 0 51 #endif 52 53 typedef struct { 54 int rank; 55 int suit; 56 } CARD; 57 58 typedef char BOOLEAN; 59 60