]> git.gir.st - solVItaire.git/blob - sol.h
bugfix: could move 2 before ace to foundation
[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 CMD_HINT,
63 CMD_HELP,
64 };
65
66 enum difficulty {
67 NORMAL,
68 MEDIUM,
69 EASY,
70 };
71
72 typedef signed char card_t;
73
74 void sol(void);
75 int find_top(card_t* pile);
76 void turn_over(card_t* pile);
77 int check_won(void);
78 void win_anim(void);
79 #ifdef KLONDIKE
80 card_t stack_take(void);
81 int t2f(int from, int to);
82 int w2f(int from, int to);
83 int s2w(int from, int to);
84 int w2s(int from, int to);
85 int f2t(int from, int to);
86 int w2t(int from, int to);
87 int t2t(int from, int to);
88 #elif defined SPIDER
89 void remove_if_complete (card_t* pile);
90 int t2t(int from, int to);
91 int s2t(int from, int to);
92 #endif
93 int nop(int from, int to);
94 int get_cmd (int* from, int* to);
95 void deal(void);
96 void print_table(void);
97 void visbell (void);
98 void append_undo (int n, int f, int t);
99 void screen_setup (int enable);
100 void raw_mode(int enable);
101
102 #endif
Imprint / Impressum