-
Notifications
You must be signed in to change notification settings - Fork 142
/
mario.cpp
196 lines (195 loc) · 5.84 KB
/
mario.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
#include <tabulate/table.hpp>
using namespace tabulate;
using Row_t = Table::Row_t;
int main() {
Table mario;
mario.format().color(Color::white).border("").corner("").column_separator("").padding(0);
size_t rows = 16;
for (size_t i = 0; i < rows; ++i) {
Row_t row;
size_t cols = 30;
for (size_t j = 0; j < cols; ++j) {
row.push_back("█");
}
mario.add_row(row);
}
// Row 0
for (size_t i = 7; i < 20; ++i) {
mario[0][i].format().color(Color::red);
}
// Row 1
for (size_t i = 5; i < 26; ++i) {
mario[1][i].format().color(Color::red);
}
// Row 2
for (size_t i = 5; i < 13; ++i) {
mario[2][i].format().color(Color::green).font_style({FontStyle::dark});
}
for (size_t i = 13; i < 18; ++i) {
mario[2][i].format().color(Color::yellow);
}
for (size_t i = 18; i < 20; ++i) {
mario[2][i].format().color(Color::green).font_style({FontStyle::dark});
}
for (size_t i = 20; i < 22; ++i) {
mario[2][i].format().color(Color::yellow);
}
// Row 3
for (size_t i = 3; i < 7; ++i) {
mario[3][i].format().color(Color::green).font_style({FontStyle::dark});
}
for (size_t i = 7; i < 9; ++i) {
mario[3][i].format().color(Color::yellow);
}
for (size_t i = 9; i < 11; ++i) {
mario[3][i].format().color(Color::green).font_style({FontStyle::dark});
}
for (size_t i = 11; i < 18; ++i) {
mario[3][i].format().color(Color::yellow);
}
for (size_t i = 18; i < 20; ++i) {
mario[3][i].format().color(Color::green).font_style({FontStyle::dark});
}
for (size_t i = 20; i < 26; ++i) {
mario[3][i].format().color(Color::yellow);
}
// Row 4
for (size_t i = 3; i < 7; ++i) {
mario[4][i].format().color(Color::green).font_style({FontStyle::dark});
}
for (size_t i = 7; i < 9; ++i) {
mario[4][i].format().color(Color::yellow);
}
for (size_t i = 9; i < 13; ++i) {
mario[4][i].format().color(Color::green).font_style({FontStyle::dark});
}
for (size_t i = 13; i < 20; ++i) {
mario[4][i].format().color(Color::yellow);
}
for (size_t i = 20; i < 22; ++i) {
mario[4][i].format().color(Color::green).font_style({FontStyle::dark});
}
for (size_t i = 22; i < 28; ++i) {
mario[4][i].format().color(Color::yellow);
}
// Row 5
for (size_t i = 3; i < 9; ++i) {
mario[5][i].format().color(Color::green).font_style({FontStyle::dark});
}
for (size_t i = 9; i < 18; ++i) {
mario[5][i].format().color(Color::yellow);
}
for (size_t i = 18; i < 26; ++i) {
mario[5][i].format().color(Color::green).font_style({FontStyle::dark});
}
// Row 6
for (size_t i = 7; i < 24; ++i) {
mario[6][i].format().color(Color::yellow);
}
// Row 7
for (size_t i = 5; i < 11; ++i) {
mario[7][i].format().color(Color::green).font_style({FontStyle::dark});
}
for (size_t i = 11; i < 13; ++i) {
mario[7][i].format().color(Color::red);
}
for (size_t i = 13; i < 20; ++i) {
mario[7][i].format().color(Color::green).font_style({FontStyle::dark});
}
// Row 8
for (size_t i = 3; i < 11; ++i) {
mario[8][i].format().color(Color::green).font_style({FontStyle::dark});
}
for (size_t i = 11; i < 13; ++i) {
mario[8][i].format().color(Color::red);
}
for (size_t i = 13; i < 18; ++i) {
mario[8][i].format().color(Color::green).font_style({FontStyle::dark});
}
for (size_t i = 18; i < 20; ++i) {
mario[8][i].format().color(Color::red);
}
for (size_t i = 20; i < 26; ++i) {
mario[8][i].format().color(Color::green).font_style({FontStyle::dark});
}
// Row 9
for (size_t i = 1; i < 11; ++i) {
mario[9][i].format().color(Color::green).font_style({FontStyle::dark});
}
for (size_t i = 11; i < 20; ++i) {
mario[9][i].format().color(Color::red);
}
for (size_t i = 20; i < 29; ++i) {
mario[9][i].format().color(Color::green).font_style({FontStyle::dark});
}
// Row 10
for (size_t i = 1; i < 7; ++i) {
mario[10][i].format().color(Color::yellow);
}
for (size_t i = 7; i < 9; ++i) {
mario[10][i].format().color(Color::green).font_style({FontStyle::dark});
}
for (size_t i = 9; i < 11; ++i) {
mario[10][i].format().color(Color::red);
}
for (size_t i = 11; i < 13; ++i) {
mario[10][i].format().color(Color::yellow);
}
for (size_t i = 13; i < 18; ++i) {
mario[10][i].format().color(Color::red);
}
for (size_t i = 18; i < 20; ++i) {
mario[10][i].format().color(Color::yellow);
}
for (size_t i = 20; i < 22; ++i) {
mario[10][i].format().color(Color::red);
}
for (size_t i = 22; i < 24; ++i) {
mario[10][i].format().color(Color::green).font_style({FontStyle::dark});
}
for (size_t i = 24; i < 29; ++i) {
mario[10][i].format().color(Color::yellow);
}
// Row 11
for (size_t i = 1; i < 9; ++i) {
mario[11][i].format().color(Color::yellow);
}
for (size_t i = 9; i < 22; ++i) {
mario[11][i].format().color(Color::red);
}
for (size_t i = 22; i < 29; ++i) {
mario[11][i].format().color(Color::yellow);
}
// Row 12
for (size_t i = 1; i < 7; ++i) {
mario[12][i].format().color(Color::yellow);
}
for (size_t i = 24; i < 29; ++i) {
mario[12][i].format().color(Color::yellow);
}
for (size_t i = 7; i < 24; ++i) {
mario[12][i].format().color(Color::red);
}
// Row 13
for (size_t i = 5; i < 14; ++i) {
mario[13][i].format().color(Color::red);
}
for (size_t i = 16; i < 24; ++i) {
mario[13][i].format().color(Color::red);
}
// Row 14
for (size_t i = 3; i < 12; ++i) {
mario[14][i].format().color(Color::green).font_style({FontStyle::dark});
}
for (size_t i = 18; i < 26; ++i) {
mario[14][i].format().color(Color::green).font_style({FontStyle::dark});
}
// Row 15
for (size_t i = 1; i < 12; ++i) {
mario[15][i].format().color(Color::green).font_style({FontStyle::dark});
}
for (size_t i = 18; i < 29; ++i) {
mario[15][i].format().color(Color::green).font_style({FontStyle::dark});
}
std::cout << mario << "\n";
}