|
|
1.1 root 1: /*
2: * Copyright (c) 1980 Regents of the University of California.
3: * All rights reserved.
4: *
5: * Redistribution and use in source and binary forms are permitted
6: * provided that: (1) source distributions retain this entire copyright
7: * notice and comment, and (2) distributions including binaries display
8: * the following acknowledgement: ``This product includes software
9: * developed by the University of California, Berkeley and its contributors''
10: * in the documentation or other materials provided with the distribution
11: * and in all advertising materials mentioning features or use of this
12: * software. Neither the name of the University nor the names of its
13: * contributors may be used to endorse or promote products derived
14: * from this software without specific prior written permission.
15: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
16: * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
17: * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
18: *
19: * @(#)deck.h 5.4 (Berkeley) 6/1/90
20: */
21:
22: /*
23: * define structure of a deck of cards and other related things
24: */
25:
26:
27: #define CARDS 52 /* number cards in deck */
28: #define RANKS 13 /* number ranks in deck */
29: #define SUITS 4 /* number suits in deck */
30:
31: #define CINHAND 4 /* # cards in cribbage hand */
32: #define FULLHAND 6 /* # cards in dealt hand */
33:
34: #define LGAME 121 /* number points in a game */
35: #define SGAME 61 /* # points in a short game */
36:
37: #define SPADES 0 /* value of each suit */
38: #define HEARTS 1
39: #define DIAMONDS 2
40: #define CLUBS 3
41:
42: #define ACE 0 /* value of each rank */
43: #define TWO 1
44: #define THREE 2
45: #define FOUR 3
46: #define FIVE 4
47: #define SIX 5
48: #define SEVEN 6
49: #define EIGHT 7
50: #define NINE 8
51: #define TEN 9
52: #define JACK 10
53: #define QUEEN 11
54: #define KING 12
55: #define EMPTY 13
56:
57: #define VAL(c) ( (c) < 9 ? (c)+1 : 10 ) /* val of rank */
58:
59:
60: #ifndef TRUE
61: # define TRUE 1
62: # define FALSE 0
63: #endif
64:
65: typedef struct {
66: int rank;
67: int suit;
68: } CARD;
69:
70: typedef char BOOLEAN;
71:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.