1: 
   2: static char sccsid[] = "	bcd.c	4.1	82/10/24	";
   3: 
   4: int chtab[] = {
   5: 00000, /*   */
   6: 03004, /* ! */
   7: 02404, /* " */
   8: 02040, /* sharp */
   9: 02042, /* $ */
  10: 02104, /* % */
  11: 00001, /* & */
  12: 03002, /* ' */
  13: 02201, /* ( */
  14: 02202, /* ) */
  15: 02102, /* * */
  16: 00005, /* + */
  17: 02044, /* , */
  18: 00002, /* - */
  19: 02041, /* . */
  20: 00014, /* / */
  21: 00004, /* 0 */
  22: 00010, /* 1 */
  23: 00020, /* 2 */
  24: 00040, /* 3 */
  25: 00100, /* 4 */
  26: 00200, /* 5 */
  27: 00400, /* 6 */
  28: 01000, /* 7 */
  29: 02000, /* 8 */
  30: 04000, /* 9 */
  31: 02200, /* : */
  32: 02402, /* ; */
  33: 02401, /* < */
  34: 02204, /* = */
  35: 02400, /* > */
  36: 03000, /* ? */
  37: 02100, /* at */
  38:  011,
  39:  021,
  40:  041,
  41: 0101,
  42: 0201,
  43: 0401,
  44: 01001,
  45: 02001,
  46: 04001,
  47: 012,
  48: 022,
  49: 042,
  50: 0102,
  51: 0202,
  52: 0402,
  53: 01002,
  54: 02002,
  55: 02002,
  56: 024,
  57: 044,
  58: 0104,
  59: 0204,
  60: 0404,
  61: 01004,
  62: 02004,
  63: 04004,
  64: 02020, /* [ */
  65: 03001, /* \ */
  66: 02101, /* ] */
  67: 00006, /* ^ */
  68: 02024 /* _ */
  69: };
  70:     char s[128];
  71:     char *sp = {&s[0]};
  72: main(argc, argv)
  73: char *argv[];
  74: {
  75:     char *spp;
  76:     int i;
  77:     int j;
  78:     int c;
  79:     int l;
  80: 
  81:     if (argc<2) {
  82:         puts("% ");
  83:         while ((c=getchar())!='\0'&c!='\n')
  84:             *sp++ = c;
  85:         *sp = 0;
  86:         sp = &s[0];
  87:     } else
  88:         sp = *++argv;
  89:     puts("\n\n\n\n");
  90:     puts(" ________________________________");
  91:     puts("________________\n");
  92:     spp = sp;
  93:     while(*spp++);
  94:     spp--;
  95:     l = spp - sp;
  96:     putchar('/');
  97:     puts(sp);
  98:     i = 49 - l;
  99:     while(--i>0) putchar(' ');
 100:     puts("|\n");
 101:     j = 0;
 102:     spp = sp;
 103:     while (j++<12) {
 104:         putchar('|');
 105:         i = 0;
 106:         spp = sp;
 107:         while (i<48) {
 108:             if(i>l) c = 0;
 109:             else c = *spp++ - 040;
 110:             i++;
 111:             if (c>='a'-040) c = c - 040;
 112:             if (c<0 | c>137) c = 0;
 113:             if ((chtab[c]>>(j-1))&1)
 114:                 puts("[]");
 115:             else
 116:                 putchar(j>3?'0'+j-3:' ');
 117:         }
 118:         puts("|\n");
 119:     }
 120:     putchar('|');
 121:     puts("____________");
 122:     puts("____________________________________");
 123:     puts("|\n");
 124:     puts("\n\n\n\n");
 125: }
 126: 
 127: puts(ss) char *ss; {
 128:     int i;
 129:     char t;
 130:     i = 0;
 131:     while(t = *ss++) {
 132:         if(t >= 'a' && t <= 'z')
 133:             t += 'A'-'a';
 134:         putchar(t);
 135:     }
 136: }

Defined functions

main defined in line 72; never used
puts defined in line 127; used 13 times

Defined variables

chtab defined in line 4; used 1 times
s defined in line 70; used 2 times
sccsid defined in line 2; never used
sp defined in line 71; used 9 times
Last modified: 1982-10-25
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 930
Valid CSS Valid XHTML 1.0 Strict