121511Smckusick /* 221511Smckusick * Copyright (c) 1980 Regents of the University of California. 3*33706Sbostic * All rights reserved. 421511Smckusick * 5*33706Sbostic * Redistribution and use in source and binary forms are permitted 6*33706Sbostic * provided that this notice is preserved and that due credit is given 7*33706Sbostic * to the University of California at Berkeley. The name of the University 8*33706Sbostic * may not be used to endorse or promote products derived from this 9*33706Sbostic * software without specific prior written permission. This software 10*33706Sbostic * is provided ``as is'' without express or implied warranty. 11*33706Sbostic * 12*33706Sbostic * @(#)deck.h 5.2 (Berkeley) 03/10/88 1321511Smckusick */ 147708Sarnold 157708Sarnold /* 167708Sarnold * define structure of a deck of cards and other related things 177708Sarnold */ 187708Sarnold 197708Sarnold 207708Sarnold #define CARDS 52 /* number cards in deck */ 217708Sarnold #define RANKS 13 /* number ranks in deck */ 227708Sarnold #define SUITS 4 /* number suits in deck */ 237708Sarnold 247708Sarnold #define CINHAND 4 /* # cards in cribbage hand */ 257708Sarnold #define FULLHAND 6 /* # cards in dealt hand */ 267708Sarnold 277708Sarnold #define LGAME 121 /* number points in a game */ 287708Sarnold #define SGAME 61 /* # points in a short game */ 297708Sarnold 307708Sarnold #define SPADES 0 /* value of each suit */ 317708Sarnold #define HEARTS 1 327708Sarnold #define DIAMONDS 2 337708Sarnold #define CLUBS 3 347708Sarnold 357708Sarnold #define ACE 0 /* value of each rank */ 367708Sarnold #define TWO 1 377708Sarnold #define THREE 2 387708Sarnold #define FOUR 3 397708Sarnold #define FIVE 4 407708Sarnold #define SIX 5 417708Sarnold #define SEVEN 6 427708Sarnold #define EIGHT 7 437708Sarnold #define NINE 8 447708Sarnold #define TEN 9 457708Sarnold #define JACK 10 467708Sarnold #define QUEEN 11 477708Sarnold #define KING 12 487872Sarnold #define EMPTY 13 497708Sarnold 507708Sarnold #define VAL(c) ( (c) < 9 ? (c)+1 : 10 ) /* val of rank */ 517708Sarnold 527708Sarnold 537872Sarnold #ifndef TRUE 547872Sarnold # define TRUE 1 557872Sarnold # define FALSE 0 567872Sarnold #endif 577708Sarnold 587708Sarnold typedef struct { 597708Sarnold int rank; 607708Sarnold int suit; 617708Sarnold } CARD; 627708Sarnold 637708Sarnold typedef char BOOLEAN; 647708Sarnold 65