-
Notifications
You must be signed in to change notification settings - Fork 1
/
TOLL.CPP
62 lines (54 loc) · 1.39 KB
/
TOLL.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
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include<dos.h>
//Included cpp files
#include"basic.cpp"
#include"about.cpp"
#include"tollgraph.cpp"
int main(void)
{
int gdriver = EGA, gmode = EGAHI, errorcode,bkcol;
char *fname = "TOLL GATE",*dev="DEVELOPED BY : MAYANK MISHRA";
/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "C:\\TC\\bgi");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
}
/* for centering text messages */
settextjustify(CENTER_TEXT, CENTER_TEXT);
midx = getmaxx() / 2;
midy = getmaxy() / 2;
cleardevice();
/* select a new background color */
setbkcolor(4);
settextjustify(CENTER_TEXT, CENTER_TEXT);
/* select the text style */
settextstyle(style, HORIZ_DIR, size);
/* output a message */
outtextxy(midx, 160, fname);
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t\t a toll gate simulation");
printf("\n\n\n\n\n\t\t\t\t ");
for(int i=0;i<10;i++)
{
printf(".");
delay(200);
}
cleardevice();
about();
delay(4000);
cleardevice();
maketoll();
rectangle(150,340,210,350);
getch();
/* clean up */
closegraph();
return 0;
}