home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / pc / source / star.lzh / star.1 / samples / colorize.c < prev    next >
Encoding:
C/C++ Source or Header  |  1990-03-27  |  426 b   |  26 lines

  1. /* To add colors to neb.star, consider the following short program */
  2.  
  3. #include <stdio.h>
  4.  
  5. main()
  6. {
  7.   char inbuf[100];
  8.  
  9.   while (gets(inbuf, 100)) {
  10.     if (inbuf[14] == 'C') { /* Cluster */
  11.     inbuf[16] = 'y';
  12.     inbuf[17] = '9';
  13.     };
  14.     if (inbuf[14] == 'N') { /* Nebula */
  15.     inbuf[16] = 'g';
  16.     inbuf[17] = '9';
  17.     };
  18.     if (inbuf[14] == 'G') { /* Galaxy */
  19.     inbuf[16] = 'r';
  20.     inbuf[17] = '9';
  21.     };
  22.     puts(inbuf);
  23.   }
  24. }
  25.  
  26.