-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMICKEY.CPP
252 lines (186 loc) · 4.4 KB
/
MICKEY.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
void f(int,int,int);
void e(int,int,int);
void ey(int,int,int,int,int,int);
void n(int,int,int,int,int);
void m(int,int,int,int,int,int);
void s(int,int,int,int);
void ft(int,int,int,int,int,int);
void r(int,int,int,int);
void main()
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int midx, midy;
int rad,sangle,endangle,xradius,yradius;
int right,left,top,bottom;
int ri,to,le,bo;
/* initialize graphics and local
variables */
initgraph(&gdriver, &gmode, "c:\\turboc3\\bgi");
e(midx,midy,rad);
f(midx,midy,rad);
n(midx,midy,sangle,endangle,rad);
m(midx,midy,sangle,endangle,xradius,yradius);
s(left,top,right,bottom);
ft(midx,midy,sangle,endangle,xradius,yradius);
r(le,to,ri,bo);
ey(midx,midy,sangle,endangle,xradius,yradius);
settextstyle(GOTHIC_FONT,0,4);
outtextxy(90,340,"Wanna");
settextstyle(GOTHIC_FONT,0,4);
outtextxy(90,370,"Play");
settextstyle(GOTHIC_FONT,0,4);
outtextxy(90,402,"Tennis...");
getch();
closegraph();
}
//function definition for cartoon's face
void f(int midx,int midy,int rad)
{
int a=getmaxx()/2;
int b=getmaxy()/4+18;
setfillstyle(1,14);
circle(a,b,70);
floodfill(a,b,15);
}
//function definition for cartoon's ear
void e(int midx,int midy,int rad)
{
midx = getmaxx() / 3+21;
midy = getmaxy() / 8+18;
setfillstyle(1,6);
circle(midx,midy,35);
floodfill(midx,midy,15);
midx=getmaxx()/3+191;
midy =getmaxy()/8+18;
setfillstyle(1,6);
circle(midx,midy,35);
floodfill(midx,midy,15);
}
//function definition for cartoon's eyes
void ey(int midx,int midy,int sangle,int endangle,int xradius,int yradius)
{
int e=getmaxx()/2-30;
int f=getmaxy()/5+18;
setfillstyle(1,8);
ellipse(e,f,0,360,15,25);
floodfill(e,f,15);
int A=getmaxy()/5+30;
setfillstyle(1,0);
ellipse(e,A,0,360,8,13);
floodfill(e,A,15);
e=getmaxx()/2+30;
f=getmaxy()/5+18;
setfillstyle(1,8);
ellipse(e,f,0,360,15,25);
floodfill(e,f,15);
int B=getmaxy()/5+30;
setfillstyle(1,0);
ellipse(e,B,0,360,8,13);
floodfill(e,A,15);
}
//function definition for cartoon's nose
void n(int midx,int midy,int sangle,int endangle,int rad)
{
int g=getmaxx()/3+107;
int h=getmaxy()/3;
setfillstyle(1,6);
pieslice(g,h,35,135, 20);
floodfill(midx,midy,15);
}
//function definition for cartoon's mouth
void m(int midx,int midy,int sangle,int endangle,int xradius,int yradius)
{
int i=getmaxx()/3+108;
int j=getmaxy()/3+20;
setfillstyle(1,6);
ellipse(i,j,0,360,20,8);
floodfill(i,j,15);
int k=getmaxx()/3+136;
int l=getmaxy()/3+12;
arc(k,l,180,270,10);
k=getmaxx()/3+80;
l=getmaxy()/3+12;
arc(k,l,265,0,10);
}
//function definition for cartoon's stomach
void s(int left,int top,int right,int bottom)
{
int x = getmaxx() / 2+1;
int y = getmaxy() / 2;
setfillstyle(1,6);
bar(x-30, y-34, x+28,y+9);
setfillstyle(2,1);
bar(x-44, y-7, x+42,y+89);
setfillstyle(2,4);
bar(x-44, y+170, x-18,y+90);
setfillstyle(2,4);
bar(x+16, y+170, x+42,y+90);
setfillstyle(2,4);
bar(x+78, y, x+95,y+40);
setfillstyle(2,4);
bar(x-45, y-9, x-85,y+9);
setfillstyle(2,4);
bar(x+42, y-9, x+95,y+9);
setfillstyle(2,4);
bar(x-98, y-9, x-82,y+40);
}
//function definition for cartoon's foots
void ft(int midx,int midy,int sangle,int endangle,int xradius,int yradius)
{
int r=getmaxx()/2-30;
int s=getmaxy()/2+185;
setfillstyle(7,1);
ellipse(r,s,0,360,24,16);
floodfill(r,s,15);
r=r+60;
setfillstyle(7,1);
ellipse(r,s,0,360,24,16);
floodfill(r,s,15);
setfillstyle(7,8);
ellipse(r+138,s-130,0,360,38,30);
floodfill(r+130,s-130,15);
r=r+58;
s=s-130;
setfillstyle(1,6);
ellipse(r,s,0,360,15,18);
floodfill(r,s,15);
r=r-178;
setfillstyle(1,6);
ellipse(r,s,0,360,15,18);
floodfill(r,s,15);
setfillstyle(1,15);
circle(r,s+13,10);
floodfill(r,s+22,15);
floodfill(r,s+15,15);
}
//function definition for cartoon's racket
void r(int le,int to,int ri, int bo)
{
le=getmaxx()/4-120;
to=getmaxy()/4-150;
ri=getmaxx()/2+280;
bo=getmaxy()/3-130;
setfillstyle(6,2);
bar(le,to,ri,bo);
to=to+480;
bo=bo+448;
setfillstyle(6,2);
bar(le,to,ri,bo);
setfillstyle(1,8);
bar(le+367,to-160,ri-147,bo-180);
ri=ri-532;
to=to-420;
setfillstyle(6,2);
bar(le,to,ri,bo);
le=getmaxx()/1-68;
to=getmaxy()/3-130;
ri=getmaxx()/2+280;
bo=getmaxy()/2+210;
setfillstyle(6,2);
bar(le,to,ri,bo);
}