]> git.gir.st - VIper.git/blob - schemes.h
speed up every 100 points
[VIper.git] / schemes.h
1 #ifndef __SCHEMES_H__
2 #define __SCHEMES_H__
3
4 #include "viiper.h" /* for enum items */
5
6 #define BORDER_T 0
7 #define BORDER_C 1
8 #define BORDER_B 2
9 #define BORDER_S 3
10 #define BORDER_L 0
11 #define BORDER_R 2
12 #define BORDER(v,h) op.sch->border[BORDER_ ## v][BORDER_ ## h]
13
14 struct scheme {
15 char* border[4][3];
16
17 char* snake[5][5]; /* [predecessor][successor] */
18 char* color[3]; /* 0=even, 1=odd, 2=head */
19
20 char* item[NUM_FOODS];
21
22 /* for en-/disabling e.g. DEC charset: */
23 char* init_seq;
24 char* reset_seq;
25
26 int cell_width; /* number of characters per cell */
27 int display_width; /* how wide a cell appears to be */
28 };
29
30 struct scheme unic0de = {
31 .border = {
32 {"╔", "══", "╗"},
33 {"║", " ", "║"},
34 {"╚", "══", "╝"},
35 { "╡","","╞" },
36 },
37
38 .snake = { /* sorted like in the enum directions */
39 {/* NONE -> */
40 /*NONE */ "",
41 /*NORTH*/ "⢿⡿",
42 /*EAST */ "⢾⣿",
43 /*SOUTH*/ "⣾⣷",
44 /*WEST */ "⣿⡷",
45 },{/* NORTH -> */
46 /*NONE */ "⢇⡸",
47 /*NORTH*/ "",
48 /*EAST */ "⢇⣈",
49 /*SOUTH*/ "⡇⢸",
50 /*WEST */ "⣁⡸",
51 },{/* EAST -> */
52 /*NONE */ "⢎⣉",
53 /*NORTH*/ "⢇⣈",
54 /*EAST */ "",
55 /*SOUTH*/ "⡎⢉",
56 /*WEST */ "⣉⣉",
57 },{/* SOUTH -> */
58 /*NONE */ "⡎⢱",
59 /*NORTH*/ "⡇⢸",
60 /*EAST */ "⡎⢉",
61 /*SOUTH*/ "",
62 /*WEST */ "⡉⢱",
63 },{/* WEST -> */
64 /*NONE */ "⣉⡱",
65 /*NORTH*/ "⣁⡸",
66 /*EAST */ "⣉⣉",
67 /*SOUTH*/ "⡉⢱",
68 /*WEST */ "",
69 },
70 },
71 .color = {"32", "92", "92;1"},
72
73 .item = {
74 [FOOD_5] = "🍐",
75 [FOOD_10] = "🍎",
76 [FOOD_20] = "🥑",
77 },
78
79 .cell_width = 2,
80 .display_width = 2,
81 };
82
83 struct scheme vt220_charset = {
84 .border = {
85 {"\033#6\x6c","\x71","\x6b"},
86 {"\033#6\x78"," ","\x78"},
87 {"\033#6\x6d","\x71","\x6a"},
88 { "=","","=" },
89 },
90
91 .snake = {
92 {"@","A",">","V","<"}, //head
93 {"#","#","#","#","#"},
94 {"#","#","#","#","#"},
95 {"#","#","#","#","#"},
96 {"#","#","#","#","#"},
97 },
98 .color = {"0", "0", "1"},
99
100 .item = { "$", "%", "&"},
101
102 .init_seq = "\033(0\033*B\x0f" /* G0=Graphics, G2=ASCII, invoke G0 */
103 "\033[?3l", /* disable 132 column mode (DECCOLM) */
104 .reset_seq = "\033(B" /* reset to DEC Multinational Character Set */
105 "\033[?3h", /* reenable DECCOLM (WARN: unconditionally!)*/
106
107 .cell_width = 1,
108 .display_width = 2,
109 };
110
111 #endif
Imprint / Impressum