]> git.gir.st - solVItaire.git/blob - sol.h
spider works, minor print cleanup
[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 special_cmds {
52 CMD_MOVE,
53 CMD_INVAL,
54 CMD_QUIT,
55 CMD_NEW,
56 };
57
58 typedef signed char card_t;
59
60 void sol(void);
61 int find_top(card_t* pile);
62 void turn_over(card_t* pile);
63 #ifdef KLONDIKE
64 card_t stack_take(void);
65 int t2f(int from, int to);
66 int w2f(int from, int to);
67 int s2w(int from, int to);
68 int w2s(int from, int to);
69 int f2t(int from, int to);
70 int w2t(int from, int to);
71 int t2t(int from, int to);
72 #elif defined SPIDER
73 int t2t(int from, int to);
74 int s2t(int from, int to);
75 #endif
76 int nop(int from, int to);
77 int get_cmd (int* from, int* to);
78 void deal(void);
79 void print_table(void);
80 void append_undo (int n, int f, int t);
81 void raw_mode(int enable);
82
83 #endif
Imprint / Impressum