-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.c
56 lines (52 loc) · 1.21 KB
/
demo.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#include "terminalgl.h"
void main()
{
char command;
tgl_init();
do
{
command = get_command();
switch(command)
{
case 'b':
set_cell_color(BLUE);
set_glyph_color(YELLOW);
break;
case 'c':
clear();
break;
case 'j':
movedown(1);
break;
case 'k':
moveup(1);
break;
case 'g':
set_square_mode(false);
case 'h':
moveleft(1);
break;
case 'l':
moveright(1);
break;
case 'q':
break;
case 'r':
set_cell_color(RED);
set_glyph_color(CYAN);
break;
case 's':
set_square_mode(true);
break;
case 'y':
set_cell_color(YELLOW);
set_glyph_color(BLUE);
break;
default:
set_glyph(command);
draw();
break;
}
} while(command != 'q');
tgl_deinit();
}