#include <conio.h>
#include <graphics.h>
#include <stdio.h>
void
red_corner();
void
blue_corner();
void
green_corner();
void
yellow_corner();
void
home();
void
line_red_blue();
void
line_green_yellow();
void
line_red_green();
void
line_yellow_blue();
void
main()
{
int
gd = DETECT, gm;
initgraph(&gd, &gm,
"C:\\turboc3\\bgi"
);
setfillstyle(SOLID_FILL, DARKGRAY);
floodfill(5, 5, 15);
rectangle(500, 200, 1250, 950);
rectangle(480, 180, 1270, 970);
setfillstyle(SOLID_FILL, BLACK);
floodfill(485, 185, 15);
red_corner();
blue_corner();
green_corner();
yellow_corner();
home();
line_red_blue();
line_green_yellow();
line_red_green();
line_yellow_blue();
getch();
closegraph();
}
void
line_yellow_blue()
{
int
x = 950;
line(950, 600, 1250, 600);
line(950, 550, 1250, 550);
while
(x < 1250) {
line(x, 500, x, 650);
setfillstyle(SOLID_FILL, BLUE);
floodfill(x + 2, 555, 15);
x = x + 50;
}
setfillstyle(SOLID_FILL, DARKGRAY);
floodfill(1240, 555, 15);
setfillstyle(SOLID_FILL, BLUE);
floodfill(1195, 605, 15);
circle(1175, 625, 10);
setfillstyle(SOLID_FILL, WHITE);
floodfill(1180, 630, 15);
circle(1125, 525, 10);
setfillstyle(SOLID_FILL, WHITE);
floodfill(1130, 530, 15);
line(950, 650, 910, 600);
line(950, 500, 910, 550);
setfillstyle(SOLID_FILL, BLUE);
floodfill(925, 575, 15);
}
void
line_red_green()
{
int
x = 500;
line(500, 600, 800, 600);
line(500, 550, 800, 550);
while
(x < 800) {
line(x, 500, x, 650);
setfillstyle(SOLID_FILL, GREEN);
floodfill(x + 2, 555, 15);
x = x + 50;
}
setfillstyle(SOLID_FILL, DARKGRAY);
floodfill(505, 555, 15);
setfillstyle(SOLID_FILL, GREEN);
floodfill(555, 505, 15);
circle(575, 525, 10);
setfillstyle(SOLID_FILL, WHITE);
floodfill(580, 530, 15);
circle(625, 625, 10);
setfillstyle(SOLID_FILL, WHITE);
floodfill(630, 630, 15);
line(800, 500, 840, 550);
line(800, 650, 840, 600);
setfillstyle(SOLID_FILL, GREEN);
floodfill(810, 575, 15);
}
void
line_red_blue()
{
int
x = 650;
line(850, 650, 850, 950);
line(900, 650, 900, 950);
while
(x <= 900) {
line(800, x, 950, x);
setfillstyle(SOLID_FILL, RED);
floodfill(855, x + 2, 15);
x = x + 50;
}
setfillstyle(SOLID_FILL, DARKGRAY);
floodfill(855, 940, 15);
setfillstyle(SOLID_FILL, RED);
floodfill(805, 895, 15);
circle(825, 875, 10);
setfillstyle(SOLID_FILL, WHITE);
floodfill(830, 880, 15);
circle(925, 825, 10);
setfillstyle(SOLID_FILL, WHITE);
floodfill(930, 830, 15);
line(800, 650, 840, 600);
line(950, 650, 910, 600);
setfillstyle(SOLID_FILL, RED);
floodfill(885, 615, 15);
}
void
line_green_yellow()
{
int
x = 200;
line(850, 200, 850, 500);
line(900, 200, 900, 500);
while
(x < 500) {
line(800, x, 950, x);
setfillstyle(SOLID_FILL, YELLOW);
floodfill(855, x + 2, 15);
x = x + 50;
}
setfillstyle(SOLID_FILL, DARKGRAY);
floodfill(855, 205, 15);
setfillstyle(SOLID_FILL, YELLOW);
floodfill(905, 255, 15);
circle(925, 275, 10);
setfillstyle(SOLID_FILL, WHITE);
floodfill(930, 280, 15);
circle(825, 325, 10);
setfillstyle(SOLID_FILL, WHITE);
floodfill(830, 330, 15);
line(800, 500, 840, 550);
line(950, 500, 910, 550);
setfillstyle(SOLID_FILL, YELLOW);
floodfill(885, 545, 15);
}
void
red_corner()
{
rectangle(500, 650, 800, 950);
rectangle(550, 700, 750, 900);
circle(600, 750, 30);
circle(700, 750, 30);
circle(600, 850, 30);
circle(700, 850, 30);
setfillstyle(SOLID_FILL, RED);
floodfill(505, 655, 15);
floodfill(615, 765, 15);
floodfill(715, 765, 15);
floodfill(615, 865, 15);
floodfill(715, 865, 15);
setfillstyle(SOLID_FILL, WHITE);
floodfill(555, 705, 15);
}
void
blue_corner()
{
rectangle(950, 650, 1250, 950);
rectangle(1000, 700, 1200, 900);
circle(1050, 750, 30);
circle(1150, 750, 30);
circle(1050, 850, 30);
circle(1150, 850, 30);
setfillstyle(SOLID_FILL, BLUE);
floodfill(955, 655, 15);
floodfill(1065, 765, 15);
floodfill(1165, 765, 15);
floodfill(1065, 865, 15);
floodfill(1165, 865, 15);
setfillstyle(SOLID_FILL, WHITE);
floodfill(1005, 705, 15);
}
void
green_corner()
{
rectangle(500, 200, 800, 500);
rectangle(550, 250, 750, 450);
circle(600, 300, 30);
circle(700, 300, 30);
circle(600, 400, 30);
circle(700, 400, 30);
setfillstyle(SOLID_FILL, GREEN);
floodfill(505, 215, 15);
floodfill(615, 315, 15);
floodfill(715, 315, 15);
floodfill(615, 415, 15);
floodfill(715, 415, 15);
setfillstyle(SOLID_FILL, WHITE);
floodfill(555, 255, 15);
}
void
yellow_corner()
{
rectangle(950, 200, 1250, 500);
rectangle(1000, 250, 1200, 450);
circle(1050, 300, 30);
circle(1150, 300, 30);
circle(1050, 400, 30);
circle(1150, 400, 30);
setfillstyle(SOLID_FILL, YELLOW);
floodfill(955, 215, 15);
floodfill(1065, 315, 15);
floodfill(1165, 315, 15);
floodfill(1065, 415, 15);
floodfill(1165, 415, 15);
setfillstyle(SOLID_FILL, WHITE);
floodfill(1005, 255, 15);
}
void
home()
{
rectangle(800, 500, 950, 650);
rectangle(840, 550, 910, 600);
setfillstyle(SOLID_FILL, BLACK);
floodfill(860, 595, 15);
settextstyle(8, 0, 3);
outtextxy(848, 560,
"HOME"
);
}