home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / MBUG / MBUG066.ARC / PHONE.C < prev    next >
Text File  |  1979-12-31  |  768b  |  25 lines

  1. int x;
  2. int d[7], i[7];
  3.  
  4. main(argc, argv)
  5. char *argv[];
  6. int  argc;
  7. {
  8.         for (x=0 ; x<=6 ; x++) {
  9.                 d[x] = (*argv[1]++)-'0';
  10.                 i[x] = 0;
  11.         }
  12.         do {
  13.                 for (x=0 ; x<=6 ; x++) {
  14.                         printf("%c", "000111ABCDEFGHIJKLMNOPRSTUVWXY"
  15.                                      [d[x]*3+i[x]]);
  16.                 }
  17.                 printf("   ");
  18.                 for (x=6 ; x>=0 ; x--) {
  19.                         if (d[x]==0 || d[x]==1) continue;
  20.                         if (++i[x]<=2) break;
  21.                         i[x]=0;
  22.                 }
  23.         } while (x!= -1);
  24. }
  25.