HUT.CPP
HUT.CPP
h>
#include<conio.h>
#include<graphics.h>
#include<math.h>
#include<stdlib.h>
void main() {
int gd = DETECT, gm;
setfillstyle(SOLID_FILL, YELLOW);
floodfill(91, 271, WHITE); // Rectangle 1
setfillstyle(SOLID_FILL, LIGHTGREEN);
floodfill(271, 221, WHITE); // Rectangle 2
floodfill(429, 289, WHITE);
setfillstyle(SOLID_FILL, CYAN);
floodfill(271, 289, WHITE); // Rectangle 2 inner
floodfill(429, 221, WHITE);
setfillstyle(SOLID_FILL,7);
floodfill(431,221,WHITE);
setfillstyle(SOLID_FILL,13);
floodfill(71,181,WHITE);
setfillstyle(SOLID_FILL, LIGHTRED);
floodfill(71, 179, WHITE); // Triangle connection
setfillstyle(SOLID_FILL, GREEN);
floodfill(529, 71, WHITE); // Side boundary
getch();
closegraph();
}
dx = x2 - x1;
dy = y2 - y1;
xinc = dx / steps;
yinc = dy / steps;
x = x1;
y = y1;
while (x < y) {
x++;
if (p < 0) {
p = p + 2 * x + 1;
} else {
y--;
p = p + 2 * x - 2 * y + 1;
}