-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCharacter Generation (Bit-Map Method).c
More file actions
77 lines (70 loc) · 2.15 KB
/
Copy pathCharacter Generation (Bit-Map Method).c
File metadata and controls
77 lines (70 loc) · 2.15 KB
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
// Name in CG – 2
#include <graphics.h>
#include <conio.h>
#include <dos.h>
void main() {
int i, j, k, x, y;
int gd = DETECT, gm;
// J
int ch1[][10] = {
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0},
{0, 0, 0, 0, 1, 1, 1, 0, 0, 0},
{1, 1, 0, 0, 1, 1, 1, 0, 0, 0},
{1, 1, 0, 0, 1, 1, 1, 0, 0, 0},
{1, 1, 1, 1, 1, 1, 1, 0, 0, 0},
{1, 1, 1, 1, 1, 1, 0, 0, 0, 0}
};
// I
int ch2[][10] = {
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
};
// A
int ch3[][10] = {
{0, 0, 0, 1, 1, 1, 1, 0, 0, 0},
{0, 0, 1, 1, 1, 1, 1, 1, 0, 0},
{1, 1, 0, 0, 0, 0, 0, 0, 1, 1},
{1, 1, 0, 0, 0, 0, 0, 0, 1, 1},
{1, 1, 0, 0, 0, 0, 0, 0, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
{1, 1, 0, 0, 0, 0, 0, 0, 1, 1},
{1, 1, 0, 0, 0, 0, 0, 0, 1, 1},
{1, 1, 0, 0, 0, 0, 0, 0, 1, 1}
};
initgraph(&gd, &gm, "..\\BGI");
setbkcolor(LIGHTGRAY); // set color of background to gray
for(k = 0; k < 7; k++) {
for(i = 0; i < 10; i++) {
for(j = 0; j < 10; j++) {
if(k == 0) {
if(ch1[i][j] == 1)
putpixel(j + 150, i + 230, RED);
}
if(k == 1) {
if(ch2[i][j] == 1)
putpixel(j + 200, i + 230, RED);
}
if(k == 2) {
if(ch3[i][j] == 1)
putpixel(j + 250, i + 230, RED);
}
}
delay(200);
}
}
getch();
closegraph();
}