Details | Last modification | View Log
Rev | Author | Line No. | Line |
---|---|---|---|
1464 | alone | 1 | void putdec(int c) |
2 | { |
||
3 | int div; |
||
4 | int hassent = 0; |
||
5 | for(div = 100; div > 0; div /= 10) { |
||
6 | int disp = c / div; |
||
7 | c %= div; |
||
8 | if((disp != 0) || (hassent) || (div == 1)) { |
||
9 | hassent = 1; |
||
10 | putchar('0'+disp); |
||
11 | } |
||
12 | } |
||
13 | } |
||
14 | |||
15 | void AT(int X, int Y) |
||
16 | { |
||
17 | putchar(27); |
||
18 | putchar('['); |
||
19 | putdec(Y); |
||
20 | putchar(';'); |
||
21 | putdec(X); |
||
22 | putchar('H'); |
||
23 | } |
||
24 | |||
25 | void ATRIB( int color) |
||
26 | { |
||
27 | putchar(27); |
||
28 | putchar('['); |
||
29 | putdec(color); |
||
30 | putchar('m'); |
||
31 | } |
||
32 | |||
33 | |||
34 | void BOX(unsigned char Xbox, unsigned char Ybox, unsigned char Wbox, unsigned char Hbox, unsigned char Cbox) |
||
35 | { |
||
36 | unsigned char x,y; |
||
37 | ATRIB(Cbox); |
||
38 | for (y = 0; y < Hbox;y++) |
||
39 | { |
||
40 | AT (Xbox,Ybox + y); |
||
41 | for (x = 0; x < Wbox;x++) |
||
42 | { |
||
43 | putchar(' '); |
||
44 | } |
||
45 | } |
||
46 | } |