home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / EN0720.ZIP / FIGURE9.C < prev    next >
Text File  |  1988-08-01  |  527b  |  18 lines

  1. VOID DrawIt (HPS hps, SHORT cxClient, SHORT cyClient)
  2.      {
  3.      RECTL rcl ;
  4.      SHORT x1, x2, y1, y2 ;
  5.  
  6.      x1 = rand() % cxClient ;
  7.      x2 = rand() % cxClient ;
  8.      y1 = rand() % cyClient ;
  9.      y2 = rand() % cyClient ;
  10.  
  11.      rcl.xLeft   = min (x1, x2) ;                      // Lower left corner
  12.      rcl.yBottom = min (y1, y2) ;
  13.      rcl.xRight  = max (x1, x2) ;                      // Upper right corner
  14.      rcl.yTop    = max (y1, y2) ;
  15.  
  16.      WinFillRect (hps, &rcl, (LONG) (rand() % 16)) ;
  17.      }
  18.