1*21511Smckusick /* 2*21511Smckusick * Copyright (c) 1980 Regents of the University of California. 3*21511Smckusick * All rights reserved. The Berkeley software License Agreement 4*21511Smckusick * specifies the terms and conditions for redistribution. 5*21511Smckusick * 6*21511Smckusick * @(#)deck.h 5.1 (Berkeley) 05/30/85 7*21511Smckusick */ 87708Sarnold 97708Sarnold /* 107708Sarnold * define structure of a deck of cards and other related things 117708Sarnold */ 127708Sarnold 137708Sarnold 147708Sarnold #define CARDS 52 /* number cards in deck */ 157708Sarnold #define RANKS 13 /* number ranks in deck */ 167708Sarnold #define SUITS 4 /* number suits in deck */ 177708Sarnold 187708Sarnold #define CINHAND 4 /* # cards in cribbage hand */ 197708Sarnold #define FULLHAND 6 /* # cards in dealt hand */ 207708Sarnold 217708Sarnold #define LGAME 121 /* number points in a game */ 227708Sarnold #define SGAME 61 /* # points in a short game */ 237708Sarnold 247708Sarnold #define SPADES 0 /* value of each suit */ 257708Sarnold #define HEARTS 1 267708Sarnold #define DIAMONDS 2 277708Sarnold #define CLUBS 3 287708Sarnold 297708Sarnold #define ACE 0 /* value of each rank */ 307708Sarnold #define TWO 1 317708Sarnold #define THREE 2 327708Sarnold #define FOUR 3 337708Sarnold #define FIVE 4 347708Sarnold #define SIX 5 357708Sarnold #define SEVEN 6 367708Sarnold #define EIGHT 7 377708Sarnold #define NINE 8 387708Sarnold #define TEN 9 397708Sarnold #define JACK 10 407708Sarnold #define QUEEN 11 417708Sarnold #define KING 12 427872Sarnold #define EMPTY 13 437708Sarnold 447708Sarnold #define VAL(c) ( (c) < 9 ? (c)+1 : 10 ) /* val of rank */ 457708Sarnold 467708Sarnold 477872Sarnold #ifndef TRUE 487872Sarnold # define TRUE 1 497872Sarnold # define FALSE 0 507872Sarnold #endif 517708Sarnold 527708Sarnold typedef struct { 537708Sarnold int rank; 547708Sarnold int suit; 557708Sarnold } CARD; 567708Sarnold 577708Sarnold typedef char BOOLEAN; 587708Sarnold 59