home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume26 / banners-1.1 / part01 / banner-05 / leb.c < prev    next >
C/C++ Source or Header  |  1993-04-11  |  4KB  |  228 lines

  1. /* leb : Large English Banner
  2.  *
  3.  * Who the heck wrote original Pascal version?
  4.  *
  5.  * C version by Han, Yun-Su
  6.  * 880505 KAIST undergraduate Dept of Life Science
  7.  */
  8.  
  9. #include <stdio.h>
  10.  
  11. main(argc, argv)
  12. int argc;
  13. char **argv;
  14. {
  15.     char line[256];
  16.  
  17.     if (argc < 2)    {
  18.         fprintf(stderr, "&:^)\n");
  19.         exit(1);
  20.         }
  21.     getline(line, argc, argv);
  22.     lowerline(line);
  23.     putline(line);
  24. }
  25.  
  26. getline(s, n, v)
  27. char *s;
  28. int n;
  29. char *v[];
  30. {
  31.     int i, j;
  32.  
  33.     strcpy(s, "");
  34.     for (i = 1; i < n; i++, s++)    {
  35.         for (j = 0; v[i][j] != '\0'; j++, s++)
  36.             *s = v[i][j];
  37.         *s = ' ';
  38.         }
  39.     s--;
  40.     *s = '\0';
  41. }
  42.  
  43. lowerline(s)
  44. char *s;
  45. {
  46.     char *p;
  47.  
  48.     for (p = s; *p != '\0'; p++)
  49.         if (*p >= 'A' && *p <= 'Z')
  50.             *p = *p - 'A' + 'a';
  51. }
  52.  
  53. #define    Height        6    /* Height of 3D Font */
  54. #define    Blank        "     "
  55. putline(s)
  56. char *s;
  57. {
  58.     static char *data[] = {
  59.         "     __      ",
  60.         "    /  \\     ",
  61.         "   /    \\    ",
  62.         "  /  /\\  \\   ",
  63.         " /  ____  \\  ",
  64.         "/__/    \\__\\ ",
  65.         " ______   ",
  66.         "|  __  \\  ",
  67.         "| |__|  | ",
  68.         "|  __  <  ",
  69.         "| |__|  | ",
  70.         "|______/  ",
  71.         "  _____  ",
  72.         " / ____| ",
  73.         "| |      ",
  74.         "| |      ",
  75.         "| |____  ",
  76.         " \\_____| ",
  77.         " ______   ",
  78.         "|  ___ \\  ",
  79.         "| |   | | ",
  80.         "| |   | | ",
  81.         "| |___| | ",
  82.         "|______/  ",
  83.         " _______  ",
  84.         "|  _____| ",
  85.         "| |___    ",
  86.         "|  ___|   ",
  87.         "| |_____  ",
  88.         "|_______| ",
  89.         " _______  ",
  90.         "|  _____| ",
  91.         "| |___    ",
  92.         "|  ___|   ",
  93.         "| |       ",
  94.         "|_|       ",
  95.         "  ______   ",
  96.         " / _____|  ",
  97.         "| |   ___  ",
  98.         "| |  |_  | ",
  99.         "| |____| | ",
  100.         " \\______/  ",
  101.         " _     _  ",
  102.         "| |   | | ",
  103.         "| |___| | ",
  104.         "|  ___  | ",
  105.         "| |   | | ",
  106.         "|_|   |_| ",
  107.         " _  ",
  108.         "| | ",
  109.         "| | ",
  110.         "| | ",
  111.         "| | ",
  112.         "|_| ",
  113.         "     _  ",
  114.         "    | | ",
  115.         "    | | ",
  116.         " _  | | ",
  117.         "| |_| | ",
  118.         " \\___/  ",
  119.         " _   __ ",
  120.         "| | / / ",
  121.         "| |/ /  ",
  122.         "|   <   ",
  123.         "| |\\ \\  ",
  124.         "|_| \\_\\ ",
  125.         " _       ",
  126.         "| |      ",
  127.         "| |      ",
  128.         "| |      ",
  129.         "| |____  ",
  130.         "|______| ",
  131.         " ___    ___  ",
  132.         "|   \\  /   | ",
  133.         "| |\\ \\/ /| | ",
  134.         "| | \\__/ | | ",
  135.         "| |      | | ",
  136.         "|_|      |_| ",
  137.         " __    _  ",
  138.         "|  \\  | | ",
  139.         "|   \\ | | ",
  140.         "| |\\ \\| | ",
  141.         "| | \\   | ",
  142.         "|_|  \\__| ",
  143.         "  ______   ",
  144.         " / ____ \\  ",
  145.         "| |    | | ",
  146.         "| |    | | ",
  147.         "| |____| | ",
  148.         " \\______/  ",
  149.         " _____   ",
  150.         "|  __ \\  ",
  151.         "| |__| | ",
  152.         "|  ___/  ",
  153.         "| |      ",
  154.         "|_|      ",
  155.         "  ______    ",
  156.         " / ____ \\   ",
  157.         "| |    | |  ",
  158.         "| |    | |  ",
  159.         "| |___|  |  ",
  160.         " \\________| ",
  161.         " _____   ",
  162.         "|  __ \\  ",
  163.         "| |__| | ",
  164.         "|  _  /  ",
  165.         "| | \\ \\  ",
  166.         "|_|  \\_\\ ",
  167.         "  _____   ",
  168.         " / ____|  ",
  169.         "| |____   ",
  170.         " \\____ \\  ",
  171.         "  ____| | ",
  172.         " |_____/  ",
  173.         " _________  ",
  174.         "|___   ___| ",
  175.         "    | |     ",
  176.         "    | |     ",
  177.         "    | |     ",
  178.         "    |_|     ",
  179.         " _     _  ",
  180.         "| |   | | ",
  181.         "| |   | | ",
  182.         "| |   | | ",
  183.         "| |___| | ",
  184.         " \\_____/  ",
  185.         "__        __ ",
  186.         "\\ \\      / / ",
  187.         " \\ \\    / /  ",
  188.         "  \\ \\  / /   ",
  189.         "   \\ \\/ /    ",
  190.         "    \\__/     ",
  191.         "__            __ ",
  192.         "\\ \\          / / ",
  193.         " \\ \\        / /  ",
  194.         "  \\ \\  /\\  / /   ",
  195.         "   \\ \\/  \\/ /    ",
  196.         "    \\__/\\__/     ",
  197.         "__    __ ",
  198.         "\\ \\  / / ",
  199.         " \\ \\/ /  ",
  200.         "  >  <   ",
  201.         " / /\\ \\  ",
  202.         "/_/  \\_\\ ",
  203.         "__     __ ",
  204.         "\\ \\   / / ",
  205.         " \\ \\_/ /  ",
  206.         "  \\   /   ",
  207.         "   | |    ",
  208.         "   |_|    ",
  209.         " _______  ",
  210.         "|____  /  ",
  211.         "    / /   ",
  212.         "   / /    ",
  213.         "  / /___  ",
  214.         " /______| ",
  215.         };
  216.     int i;
  217.     char *p;
  218.  
  219.     for (i = 0; i < Height; i++)    {
  220.         for (p = s; *p != '\0'; p++)
  221.             if (*p < 'a' || *p > 'z')
  222.                 printf(Blank);
  223.             else
  224.                 printf("%s", data[(*p - 'a') * Height + i]);
  225.         printf("\n");
  226.         }
  227. }
  228.