home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / alde_c / misc / graph / simgrafc / demo2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1985-02-10  |  512 b   |  34 lines

  1. #include    <stdio.h>
  2.  
  3. #define XMAX      319
  4. #define YMAX      199
  5. #define COLORMAX    3
  6. #define WXMAX     220
  7. #define WXMIN     100
  8. #define WYMAX     150
  9. #define WYMIN      50
  10.  
  11. main()
  12. {
  13. int i,x,y,clr;
  14.  
  15.    g_init();
  16.    g_pal(0);
  17.    g_bakgnd(0);
  18.    g_window(WXMIN,WYMIN,WXMAX,WYMAX);
  19.  
  20.  
  21.    randseed(1,1);
  22.  
  23.    for (i=0; i<=10000; ++i)
  24.        {
  25.        x = rand(XMAX);
  26.        y = rand(YMAX);
  27.        clr = 1 + rand(COLORMAX);
  28.        g_dot(x,y,clr);
  29.        }
  30.    getch();
  31.    g_text(80);
  32. }
  33.  
  34.