]> git.gir.st - solVItaire.git/blob - sol.h
sol prototype complete, bunch of small stuff
[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 enum special_cmds {
58 CMD_MOVE,
59 CMD_INVAL,
60 CMD_QUIT,
61 CMD_NEW,
62 };
63
64 enum difficulty {
65 NORMAL,
66 MEDIUM,
67 EASY,
68 };
69
70 typedef signed char card_t;
71
72 void sol(void);
73 int find_top(card_t* pile);
74 void turn_over(card_t* pile);
75 int check_won(void);
76 #ifdef KLONDIKE
77 card_t stack_take(void);
78 int t2f(int from, int to);
79 int w2f(int from, int to);
80 int s2w(int from, int to);
81 int w2s(int from, int to);
82 int f2t(int from, int to);
83 int w2t(int from, int to);
84 int t2t(int from, int to);
85 #elif defined SPIDER
86 int t2t(int from, int to);
87 int s2t(int from, int to);
88 #endif
89 int nop(int from, int to);
90 int get_cmd (int* from, int* to);
91 void deal(void);
92 void print_table(void);
93 void visbell (void);
94 void append_undo (int n, int f, int t);
95 void screen_setup (int enable);
96 void raw_mode(int enable);
97
98 #endif
Imprint / Impressum