]>
git.gir.st - solVItaire.git/blob - sol.h
4 #define SHORTHELP "%s [OPTIONS]\n"
6 #define LONGHELP_SPECIFIC ""
7 #define DIRECT_ADDR_KEYHELP \
8 " 1 .. 7: directly address tableu\n" \
9 " 8,9,0 : directly address stock/waste/foundation\n"
11 #define LONGHELP_SPECIFIC \
12 " -d(ifficulty) (eady|medium|hard)\n"
13 #define DIRECT_ADDR_KEYHELP \
14 " 1 .. 0: directly address tableu\n"
19 " -o(ption) (consv=conserve vertical space)\n" \
20 " -s(cheme) (color|mono|small)\n" \
25 " hjkl : move cursor\n" \
26 " H, L : move cursor to first/last tableu pile\n" \
27 " J, K : join to here, show hint\n" \
28 " n, q : new game, quit\n" \
29 " space : select at cursor\n" \
30 " return: draw from stock\n" \
36 CLU_A
, DIA_A
, HEA_A
, SPA_A
,
37 CLU_2
, DIA_2
, HEA_2
, SPA_2
,
38 CLU_3
, DIA_3
, HEA_3
, SPA_3
,
39 CLU_4
, DIA_4
, HEA_4
, SPA_4
,
40 CLU_5
, DIA_5
, HEA_5
, SPA_5
,
41 CLU_6
, DIA_6
, HEA_6
, SPA_6
,
42 CLU_7
, DIA_7
, HEA_7
, SPA_7
,
43 CLU_8
, DIA_8
, HEA_8
, SPA_8
,
44 CLU_9
, DIA_9
, HEA_9
, SPA_9
,
45 CLU_X
, DIA_X
, HEA_X
, SPA_X
,
46 CLU_J
, DIA_J
, HEA_J
, SPA_J
,
47 CLU_Q
, DIA_Q
, HEA_Q
, SPA_Q
,
48 CLU_K
, DIA_K
, HEA_K
, SPA_K
,
81 OK
, /*move successful*/
91 /* WARN: stock must always follow immediately after `TAB_*`! */
92 #define TAB_MAX (STOCK-1)
106 #define WASTE 0; /* need it for get_cmd(), but don't count it in NUM_PLACES */
107 #elif defined KLONDIKE
131 typedef signed char card_t
;
135 int opt
; /* klondike: foundation id; spider: move nth movable card */
137 const struct cursor no_hi
= {-1, -1};
142 int find_top(card_t
* pile
);
143 int first_movable(card_t
* pile
);
144 void turn_over(card_t
* pile
);
146 int rank_next (card_t a
, card_t b
);
147 int is_consecutive (card_t
* pile
, int pos
);
148 int is_movable(card_t
* pile
, int n
);
150 card_t
stack_take(void);
151 int t2f(int from
, int to
, int opt
);
152 int w2f(int from
, int to
, int opt
);
153 int s2w(int from
, int to
, int opt
);
154 int w2s(int from
, int to
, int opt
);
155 int f2t(int from
, int to
, int opt
);
156 int w2t(int from
, int to
, int opt
);
157 int t2t(int from
, int to
, int opt
);
159 void remove_if_complete (card_t
* pile
);
160 int t2t(int from
, int to
, int opt
);
161 int s2t(int from
, int to
, int opt
);
163 int nop(int from
, int to
, int opt
);
164 int get_cmd (int* from
, int* to
, int* opt
);
166 void print_hi(int invert
, int grey_bg
, int bold
, char* str
);
167 void print_table(const struct cursor
* active
, const struct cursor
* inactive
);
170 void append_undo (int n
, int f
, int t
);
171 void screen_setup (int enable
);
172 void raw_mode(int enable
);
173 void signal_handler (int signum
);
174 void signal_setup(void);