-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCOCONUT2.CPP
More file actions
64 lines (51 loc) · 1.09 KB
/
COCONUT2.CPP
File metadata and controls
64 lines (51 loc) · 1.09 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
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
void arc1();
void arc2();
void arc3();
int midx, midy;
int stangle = 0, endangle = 180;
int radius = 20;
int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
/* initialize graphics and local
variables */
initgraph(&gdriver, &gmode, "");
/* read result of initialization */
errorcode = graphresult();
/* an error occurred */
if (errorcode != grOk)
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
}
midx = getmaxx() / 2;
midy = getmaxy() / 2;
setcolor(getmaxcolor());
/* draw arc */
arc1();
arc2();
arc3();
/* clean up */
getch();
closegraph();
return 0;
}
void arc1()
{
arc(midx-50,midy,stangle,endangle,radius);
}
void arc2()
{
arc(midx,midy, stangle, endangle, radius);
}
void arc3()
{
arc(midx+50,midy,stangle, endangle, radius);
}