-
Notifications
You must be signed in to change notification settings - Fork 3
/
map.cpp
271 lines (243 loc) · 5.43 KB
/
map.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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
#include<graphics.h>
#include<iostream>
using namespace std;
void House1Mall1(int color)
{
setcolor(color);
line(75,50,155,50);
setcolor(color);
setbkcolor(15);
settextstyle(8,0,3);
outtextxy(95,25,"5km");
}
void Mall1House2(int color)
{
setcolor(color);
line(180,75,180,145);
setcolor(color);
setbkcolor(15);
settextstyle(8,0,3);
outtextxy(190,100,"7km");
}
void House2House3(int color)
{
setcolor(color);
line(75,170,155,170);
setcolor(color);
setbkcolor(15);
settextstyle(8,0,3);
outtextxy(95,145,"9km");
}
void House1House3(int color)
{
setcolor(color);
line(50,75,50,145);
setcolor(color);
setbkcolor(15);
settextstyle(8,0,3);
outtextxy(0,100,"2km");
}
void House3Mall2(int color)
{
setcolor(color);
line(50,195,50,295);
setcolor(color);
setbkcolor(15);
settextstyle(8,0,3);
outtextxy(0,240,"4km");
}
void Mall2House4(int color)
{
setcolor(color);
line(75,320,305,320);
setcolor(color);
setbkcolor(15);
settextstyle(8,0,3);
outtextxy(170,295,"15km");
}
void House4Mall3(int color)
{
setcolor(color);
line(330,195,330,295);
setcolor(color);
setbkcolor(15);
settextstyle(8,0,3);
outtextxy(340,235,"3km");
}
void Mall3House2(int color)
{
setcolor(color);
line(205,170,305,170);
setcolor(color);
setbkcolor(15);
settextstyle(8,0,3);
outtextxy(235,145,"6km");
}
void Mall1House5(int color)
{
setcolor(color);
line(205,50,425,50);
setcolor(color);
setbkcolor(15);
settextstyle(8,0,3);
outtextxy(305,25,"8km");
}
void House5Mall4(int color)
{
setcolor(color);
line(450,75,450,295);
setcolor(color);
setbkcolor(15);
settextstyle(8,0,3);
outtextxy(460,180,"11km");
}
void House4Mall4(int color)
{
setcolor(color);
line(355,320,425,320);
setcolor(color);
setbkcolor(15);
settextstyle(8,0,3);
outtextxy(370,290,"1km");
}
void Cab1(char *cab)
{
setcolor(BLACK);
circle(115,105,30);
setfillstyle(SOLID_FILL,YELLOW);
floodfill(115,105,BLACK);
setcolor(BLACK);
setbkcolor(YELLOW);
settextstyle(2,0,6);
outtextxy(90,97,cab);
}
void Cab2(char *cab)
{
setcolor(BLACK);
circle(350,105,30);
setfillstyle(SOLID_FILL,YELLOW);
floodfill(350,105,BLACK);
setcolor(BLACK);
setbkcolor(YELLOW);
settextstyle(2,0,6);
outtextxy(325,97,cab);
}
void Cab3(char *cab)
{
setcolor(BLACK);
circle(200,240,30);
setfillstyle(SOLID_FILL,YELLOW);
floodfill(200,240,BLACK);
setcolor(BLACK);
setbkcolor(YELLOW);
settextstyle(2,0,6);
outtextxy(175,233,cab);
}
int main()
{
initwindow(640,480,"Map");
//bg
setbkcolor(15);
setfillstyle(SOLID_FILL,15);
floodfill(1,1,15);
//mall 1
setcolor(BLACK);
rectangle(155,25,205,75);
setfillstyle(SOLID_FILL,12);
floodfill(156,26,BLACK);
setcolor(BLACK);
setbkcolor(12);
settextstyle(2,0,5);
outtextxy(160,45,"Mall 1");
//mall 2
setcolor(BLACK);
rectangle(25,295,75,345);
setfillstyle(SOLID_FILL,12);
floodfill(26,296,BLACK);
setcolor(BLACK);
setbkcolor(12);
settextstyle(2,0,5);
outtextxy(30,315,"Mall 2");
//mall 3
setcolor(BLACK);
rectangle(305,145,355,195);
setfillstyle(SOLID_FILL,12);
floodfill(306,146,BLACK);
setcolor(BLACK);
setbkcolor(12);
settextstyle(2,0,5);
outtextxy(310,165,"Mall 3");
//mall 4
setcolor(BLACK);
rectangle(425,295,475,345);
setfillstyle(SOLID_FILL,12);
floodfill(426,296,BLACK);
setcolor(BLACK);
setbkcolor(12);
settextstyle(2,0,5);
outtextxy(430,315,"Mall 4");
//house 1
setcolor(BLACK);
rectangle(25,25,75,75);
setfillstyle(SOLID_FILL,7);
floodfill(26,26,BLACK);
setcolor(BLACK);
setbkcolor(7);
settextstyle(2,0,4);
outtextxy(28,45,"House 1");
//house 2
setcolor(BLACK);
rectangle(155,145,205,195);
setfillstyle(SOLID_FILL,7);
floodfill(156,156,BLACK);
setcolor(BLACK);
setbkcolor(7);
settextstyle(2,0,4);
outtextxy(158,165,"House 2");
//house 3
setcolor(BLACK);
rectangle(25,145,75,195);
setfillstyle(SOLID_FILL,7);
floodfill(26,146,BLACK);
setcolor(BLACK);
setbkcolor(7);
settextstyle(2,0,4);
outtextxy(28,165,"House 3");
//house 4
setcolor(BLACK);
rectangle(305,295,355,345);
setfillstyle(SOLID_FILL,7);
floodfill(306,296,BLACK);
setcolor(BLACK);
setbkcolor(7);
settextstyle(2,0,4);
outtextxy(308,315,"House 4");
//house 5
setcolor(BLACK);
rectangle(425,25,475,75);
setfillstyle(SOLID_FILL,7);
floodfill(426,26,BLACK);
setcolor(BLACK);
setbkcolor(7);
settextstyle(2,0,4);
outtextxy(428,45,"House 5");
char cab1[10]="Cab1";
char cab2[10]="Cab2";
char cab3[10]="Cab3";
Cab1(cab1);
Cab2(cab2);
Cab3(cab3);
int color=5;
House1Mall1(color);
Mall1House2(color);
House2House3(color);
House1House3(color);
House3Mall2(color);
Mall2House4(color);
House4Mall3(color);
Mall3House2(color);
Mall1House5(color);
House5Mall4(color);
House4Mall4(color);
getch();
}