forked from Linus0080/TongJi65472
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path65472color.c
39 lines (39 loc) · 891 Bytes
/
65472color.c
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
#include <stdio.h>
#include <wchar.h>
#include <locale.h>
void block_r() {
setlocale(LC_CTYPE, "");
wchar_t block = 0x2588;
printf("\033[0;31m");
wprintf(L"%2lc", block);
}
void block_b() {
setlocale(LC_CTYPE, "");
wchar_t block = 0x2588;
printf("\033[0;34m");
wprintf(L"%2lc", block);
}
int main() {
int chart[5][7] = {{1,1,1,1,1,1},{1,1,1,1,1},{1,1,1,1},{1,1,1,1,1,1,1},{1,1}};
int i,j;
for (i = 0; i < 5; i++)
{
if (i % 2 == 0) {
for (j = 0; j < 7; j++) {
if (chart[i][j] != 0) {
block_r();
}
}
}
else if (i % 2 == 1) {
for (j = 0; j < 7; j++) {
if (chart[i][j] != 0) {
block_b();
}
}
}
printf("\033[0m");
printf("\n\n");
}
return 0;
}