]> git.gir.st - minesVIiper.git/blob - schemes.h
don't warn on too many mines; minor cleanup, ideas for stomp-radius
[minesVIiper.git] / schemes.h
1 /*
2 contains color/monchrome schemes for tty-mines.
3 */
4 #ifndef __SCHEMES_H__
5 #define __SCHEMES_H__
6
7 #define SGR(color, string) "\033[" color "m" string "\033[0m"
8 #define BOLD "1"
9 #define BLINK "5"
10 #define REV "7"
11 #define RED "31"
12 #define GREEN "32"
13 #define YELLOW "33"
14 #define BLUE "34"
15 #define CYAN "36"
16 #define GREY "37"
17 #define BRED "91"
18 #define BBLUE "94"
19 #define WHITE "97"
20
21 enum e_emoticons {
22 EMOT_SMILE,
23 EMOT_DEAD,
24 EMOT_WON,
25 EMOT_OHH,
26 NUM_EMOT,
27 };
28
29 enum e_border_lines {
30 B_TOP,
31 B_STATUS,
32 B_DIVIDER,
33 B_FIELD,
34 B_BOTTOM,
35 };
36 enum e_border_cols {
37 B_LEFT,
38 B_MIDDLE,
39 B_RIGHT,
40 };
41
42 struct minescheme {
43 char* number[9];
44 char* field_closed;
45 char* field_flagged;
46 char* field_question;
47 char* mine_normal;
48 char* mine_death;
49 char* mine_wrongf;
50 char* mine_wrongq;
51
52 char* emoticons[NUM_EMOT];
53
54 char* border[5][3];
55
56 int cell_width;
57 char* init_seq;
58 char* reset_seq;
59 };
60
61 struct minescheme symbols_mono = {
62 .number = {" ", "1", "2", "3", "4", "5", "6", "7", "8"},
63 .field_closed = "░░",
64 .field_flagged = "▕▀",
65 .field_question = "?",
66 .mine_normal = "*",
67 .mine_death = "#",
68 .mine_wrongf = "/",
69 .mine_wrongq = "\",
70
71 .emoticons = {":)", ":(", ":D", ":o"},
72
73 .border = {{"╔═","══","═╗"},
74 {"║ "," "," ║"},
75 {"╟─","──","─╢"},
76 {"║ "," "," ║"},
77 {"╚═","══","═╝"}},
78
79 .cell_width = 2,
80 };
81
82 struct minescheme symbols_col1 = {
83 .number = {" ",
84 SGR(BBLUE, "1"),
85 SGR(GREEN, "2"),
86 SGR(RED, "3"),
87 SGR(BLUE, "4"),
88 SGR(YELLOW,"5"),
89 SGR(CYAN, "6"),
90 SGR(GREY, "7"),
91 SGR(WHITE, "8")},
92 .field_closed = "░░",
93 .field_flagged = SGR(GREY,"▕\033["BRED"m▀"),
94 .field_question = "?",
95 .mine_normal = "*",
96 .mine_death = SGR(RED,"*"),
97 .mine_wrongf = "/",
98 .mine_wrongq = "\",
99
100 .emoticons = {":)", ":(", ":D", ":o"},
101
102 .border = {{"╔═","══","═╗"},
103 {"║ "," "," ║"},
104 {"╟─","──","─╢"},
105 {"║ "," "," ║"},
106 {"╚═","══","═╝"}},
107
108 .cell_width = 2,
109 };
110
111 struct minescheme symbols_doublewidth = {
112 /* for the vt220.
113 DEC Special Graphics Character Set:
114 http://vt100.net/docs/vt220-rm/table2-4.html
115 Dynamically Redefinable Character Set:
116 https://vt100.net/docs/vt220-rm/chapter4.html#S4.16 */
117 .number = {" ",
118 SGR(BOLD,"1"),
119 SGR(BOLD,"2"),
120 SGR(BOLD,"3"),
121 SGR(BOLD,"4"),
122 SGR(BOLD,"5"),
123 SGR(BOLD,"6"),
124 SGR(BOLD,"7"),
125 SGR(BOLD,"8")},
126 .field_closed = "\x61",
127 .field_flagged = SGR(BOLD,"\033O!"),
128 .field_question = SGR(BOLD,"?"),
129 .mine_normal = SGR(BOLD,"*"),
130 .mine_death = SGR(BOLD,"#"),
131 .mine_wrongf = SGR(BOLD,"/"),
132 .mine_wrongq = SGR(BOLD,"\\"),
133
134 .emoticons = {":)", ":(", ":D", "\033(B:o\033(0"},
135
136 .border = {{"\033#6\x6c","\x71","\x6b"},
137 {"\033#6\x78"," ","\x78"},
138 {"\033[?25l\033#6\x74","\x71","\x75"},
139 {"\033#6\x78"," ","\x78"},
140 {"\033#6\x6d","\x71","\x6a"}},
141
142 .cell_width = 1,
143 .init_seq = "\033P0;1;0;4;1;1{P" /*config for DRCS "P": 7x10,erase-all*/
144 "??~^^^^/??N????\033\\" /* flag at '!' resembling ▕▀ */
145 "\033(0\033+P\x0f" /*G0=Graphics,G3="P",lock charset to G0*/
146 "\033[?3l", /* disable 132 column mode (DECCOLM) */
147 .reset_seq = "\033(B" /* reset to DEC Multinational Character Set */
148 "\033[?3h", /* reenable DECCOLM (WARN: unconditionally!) */
149 };
150
151 #undef SGR
152 #undef BOLD
153 #undef BLINK
154 #undef RED
155 #undef GREEN
156 #undef YELLOW
157 #undef BLUE
158 #undef CYAN
159 #undef GREY
160 #undef BRED
161 #undef BBLUE
162 #undef WHITE
163 #endif
Imprint / Impressum