]> git.gir.st - solVItaire.git/blob - sol.h
make movable cards bold (useful in spider)
[solVItaire.git] / sol.h
1 #ifndef __SOL_H__
2 #define __SOL_H__
3
4 #define DECK_SIZE 52
5 enum cards {
6 NO_CARD,
7 CLU_A, DIA_A, HEA_A, SPA_A,
8 CLU_2, DIA_2, HEA_2, SPA_2,
9 CLU_3, DIA_3, HEA_3, SPA_3,
10 CLU_4, DIA_4, HEA_4, SPA_4,
11 CLU_5, DIA_5, HEA_5, SPA_5,
12 CLU_6, DIA_6, HEA_6, SPA_6,
13 CLU_7, DIA_7, HEA_7, SPA_7,
14 CLU_8, DIA_8, HEA_8, SPA_8,
15 CLU_9, DIA_9, HEA_9, SPA_9,
16 CLU_X, DIA_X, HEA_X, SPA_X,
17 CLU_J, DIA_J, HEA_J, SPA_J,
18 CLU_Q, DIA_Q, HEA_Q, SPA_Q,
19 CLU_K, DIA_K, HEA_K, SPA_K,
20 _NUM_CARDS_internal
21 };
22 enum colors {
23 BLK,
24 RED,
25 NUM_COLORS
26 };
27 enum suits {
28 CLUBS,
29 DIAMONDS,
30 HEARTS,
31 SPADES,
32 NUM_SUITS
33 };
34 enum ranks {
35 RANK_A,
36 RANK_2,
37 RANK_3,
38 RANK_4,
39 RANK_5,
40 RANK_6,
41 RANK_7,
42 RANK_8,
43 RANK_9,
44 RANK_X,
45 RANK_J,
46 RANK_Q,
47 RANK_K,
48 NUM_RANKS
49 };
50
51 enum action_return {
52 OK, /*move successful*/
53 ERR, /*invalid move*/
54 WON, /*game won*/
55 };
56
57 #define NO_HI -1 /* print_table()'s highlighter also uses field_places */
58 enum field_places {
59 TAB_1,
60 TAB_2,
61 TAB_3,
62 TAB_4,
63 TAB_5,
64 TAB_6,
65 TAB_7,
66 #ifdef SPIDER
67 TAB_8,
68 TAB_9,
69 TAB_10,
70 STOCK,
71 #define WASTE 0; /* need it for get_cmd(), but don't count it in NUM_PLACES */
72 #elif defined KLONDIKE
73 STOCK,
74 WASTE,
75 FOUNDATION,
76 #endif
77 NUM_PLACES,
78 };
79 enum special_cmds {
80 CMD_MOVE,
81 CMD_INVAL,
82 CMD_QUIT,
83 CMD_NEW,
84 CMD_HINT,
85 CMD_HELP,
86 CMD_FIND,
87 };
88
89 enum difficulty {
90 NORMAL,
91 MEDIUM,
92 EASY,
93 };
94
95 typedef signed char card_t;
96
97 void sol(void);
98 int find_top(card_t* pile);
99 void turn_over(card_t* pile);
100 int check_won(void);
101 void win_anim(void);
102 #ifdef KLONDIKE
103 card_t stack_take(void);
104 int t2f(int from, int to);
105 int w2f(int from, int to);
106 int s2w(int from, int to);
107 int w2s(int from, int to);
108 int f2t(int from, int to);
109 int w2t(int from, int to);
110 int t2t(int from, int to);
111 #elif defined SPIDER
112 void remove_if_complete (card_t* pile);
113 int t2t(int from, int to);
114 int s2t(int from, int to);
115 #endif
116 int nop(int from, int to);
117 int get_cmd (int* from, int* to);
118 void deal(void);
119 void print_table(int highlight);
120 void visbell (void);
121 void append_undo (int n, int f, int t);
122 void screen_setup (int enable);
123 void raw_mode(int enable);
124
125 #endif
Imprint / Impressum