forked from actionanand/cppGraphicsExamples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHut.cpp
More file actions
32 lines (29 loc) · 698 Bytes
/
Hut.cpp
File metadata and controls
32 lines (29 loc) · 698 Bytes
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
#include <stdio.h>
#include <graphics.h>
#include <dos.h>
int main()
{
int gd = DETECT, gm;
initgraph(&gd, &gm, "X:\\TC\\BGI");
/* Draw Hut */
setcolor(WHITE);
rectangle(150, 180, 250, 300);
rectangle(250, 180, 420, 300);
rectangle(180, 250, 220, 300);
line(200, 100, 150, 180);
line(200, 100, 250, 180);
line(200, 100, 370, 100);
line(370, 100, 420, 180);
/* Fill colours */
setfillstyle(SOLID_FILL, BROWN);
floodfill(152, 182, WHITE);
floodfill(252, 182, WHITE);
setfillstyle(SLASH_FILL, BLUE);
floodfill(182, 252, WHITE);
setfillstyle(HATCH_FILL, GREEN);
floodfill(200, 105, WHITE);
floodfill(210, 105, WHITE);
getch();
closegraph();
return 0;
}