90, 140, 100, 140,

90, 180, 100, 180,

90, 180, 90, 190,

100, 180, 100, 190

;

main()

union k

char c[2];

int i;

key;

mode(4); /* 젠 = 4 */

palette(0); /* = 0 */

/* , */

line (30, 70, 30, 260, 2);

line (160, 70, 160, 260, 2);

line (30, 70, 160, 70, 2);

line (30, 260, 160, 260, 2);

display_object(house, 17);

getchar();

rotate_object(house, 0.025, 90, 160, 17);

mode(3);

/* */

void palette(pnum)

int pnum;

union REGS r;

r.h.bh = 1; /* 4 */

r.h.bl = pnum;

r.h.ah = 11;

int86(0x10, &r, &r);

/* */

void mode(mode_code)

int mode_code;

union REGS r;

r.h.al = mode_code;

r.h.ah = 0;

int86(0x10, &r, &r);

/* */

void line(start_x, start_y, endx, endy, color)

int start_x, start_y, endx, endy, color;

register int t, distance;

int x=0, y=0, delta_x, delta_y;

int incx, incy;

/* x y */

delta_x = endx-start_x;

delta_y = endy-start_y;

/* */

if(delta_x>0)

incx=1;

else

if(delta_x==0)

incx=0;

else

incx= -1;

if(delta_y>0)

incy=1;

else

if(delta_y==0)

incy=0;

else

incy= -1;

delta_x=abs(delta_x);

delta_y=abs(delta_y);

if(delta_x>delta_y)

distance=delta_x;

else

distance=delta_y;

/* */

for(t=0; t<=distance; t++)

mempoint(start_x, start_y, color);

x+=delta_x;

y+=delta_y;

if(x>distance)

x-=distance;

start_x+=incx;

if(y>distance)

y-=distance;

start_y+=incy;


    







Forekc.ru
, , , , , , , , , ,