121511Smckusick /* 2*60777Sbostic * Copyright (c) 1980, 1993 3*60777Sbostic * The Regents of the University of California. All rights reserved. 421511Smckusick * 542576Sbostic * %sccs.include.redist.c% 633706Sbostic * 7*60777Sbostic * @(#)deck.h 8.1 (Berkeley) 05/31/93 821511Smckusick */ 97708Sarnold 107708Sarnold /* 117708Sarnold * define structure of a deck of cards and other related things 127708Sarnold */ 137708Sarnold 147708Sarnold 157708Sarnold #define CARDS 52 /* number cards in deck */ 167708Sarnold #define RANKS 13 /* number ranks in deck */ 177708Sarnold #define SUITS 4 /* number suits in deck */ 187708Sarnold 197708Sarnold #define CINHAND 4 /* # cards in cribbage hand */ 207708Sarnold #define FULLHAND 6 /* # cards in dealt hand */ 217708Sarnold 227708Sarnold #define LGAME 121 /* number points in a game */ 237708Sarnold #define SGAME 61 /* # points in a short game */ 247708Sarnold 257708Sarnold #define SPADES 0 /* value of each suit */ 267708Sarnold #define HEARTS 1 277708Sarnold #define DIAMONDS 2 287708Sarnold #define CLUBS 3 297708Sarnold 307708Sarnold #define ACE 0 /* value of each rank */ 317708Sarnold #define TWO 1 327708Sarnold #define THREE 2 337708Sarnold #define FOUR 3 347708Sarnold #define FIVE 4 357708Sarnold #define SIX 5 367708Sarnold #define SEVEN 6 377708Sarnold #define EIGHT 7 387708Sarnold #define NINE 8 397708Sarnold #define TEN 9 407708Sarnold #define JACK 10 417708Sarnold #define QUEEN 11 427708Sarnold #define KING 12 437872Sarnold #define EMPTY 13 447708Sarnold 457708Sarnold #define VAL(c) ( (c) < 9 ? (c)+1 : 10 ) /* val of rank */ 467708Sarnold 477708Sarnold 487872Sarnold #ifndef TRUE 497872Sarnold # define TRUE 1 507872Sarnold # define FALSE 0 517872Sarnold #endif 527708Sarnold 537708Sarnold typedef struct { 547708Sarnold int rank; 557708Sarnold int suit; 567708Sarnold } CARD; 577708Sarnold 587708Sarnold typedef char BOOLEAN; 597708Sarnold 60