home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / WGT_TC21.ZIP / WGT02.C < prev    next >
C/C++ Source or Header  |  1992-07-17  |  578b  |  26 lines

  1. #include <conio.h>
  2. #include "c:\tc\wgt\wgt.h"
  3.  
  4. /*   WORDUP Graphics Toolkit   Version 2.1
  5.      Demonstration program 2
  6.  
  7. Draw pixels with random colour in random places until you hit a key.
  8. ***** wgetpixel will return the colour at a specific coordinate. It
  9. is not included in this example file.
  10.  
  11. */
  12.  
  13. int x,y,col;
  14.  
  15. void main(void)
  16. {
  17. vga256();        // initializes system
  18. do {
  19.    wsetcolor(rand() % 255);
  20.    x=rand() % 320;
  21.    y=rand() % 200;
  22.    wputpixel(x,y);
  23.    } while (kbhit()==0);
  24. getch();        // get the key
  25. textmode(C80);        // used to return to text mode
  26. }