home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / qc_prog / chap04 / animate.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-04-05  |  982 b   |  48 lines

  1.  
  2. /* ANIMATE.C -- animate a graphics character */
  3. /*              until a key is pressed       */
  4.  
  5. /* Special characters */
  6. #define RTARROW 175
  7. #define LFTARROW 174
  8. #define BLANK 32
  9. #define BACKSPACE 8
  10.  
  11. main()
  12. {
  13.     int pos, i, j = 1;
  14.     while ( !kbhit() )
  15.         {
  16.         pos = 1;
  17.         while (pos < 79)
  18.             {
  19.             putch(RTARROW);
  20.             i = 1;
  21.             while (i < 1000)
  22.                 {
  23.                 j = i + 10;
  24.                 i++;
  25.                 }
  26.             putch(BACKSPACE);
  27.             putch(BLANK);
  28.             pos++;
  29.             }
  30.         while (pos > 1)
  31.             {
  32.             putch(LFTARROW);
  33.             i = 1;
  34.             while (i < 1000)
  35.                 {
  36.                 j = i + 10;
  37.                 i++;
  38.                 }
  39.             putch(BACKSPACE);
  40.             putch(BLANK);
  41.             putch(BACKSPACE);
  42.             putch(BACKSPACE);
  43.             pos--;
  44.             }
  45.         }
  46. }
  47.  
  48.