home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_200 / 286_02 / rect.c < prev    next >
Text File  |  1989-05-25  |  640b  |  27 lines

  1. #include <stdio.h>
  2. #include <gds.h>
  3.  
  4. Box(x1,y1,width,height,hw,vw)
  5. int x1,y1,width,height,hw,vw;
  6. {
  7.     if ((hw << 1) >= height || (vw << 1) >= width)
  8.         HorzLine(x1,y1,width,height);
  9.     HorzLine(x1,y1,width,hw);
  10.     y1+=hw; 
  11.     height -= hw << 1;
  12.     HorzLine(x1,y1+height,width,hw);
  13.     VertLine(x1,y1,height,vw);
  14.     VertLine(x1+width-vw,y1,height,vw);
  15. }
  16.  
  17. Rectangle(x1,y1,width,height)
  18. int x1,y1,width,height;
  19. {
  20.     HorzLine(x1,y1++,width,1);
  21.     height -= 2;
  22.     HorzLine(x1,y1+height,width,1);
  23.     VertLine(x1,y1,height,1);
  24.     VertLine(x1+width-1,y1,height,1);
  25. }
  26.  
  27.