home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1634 < prev    next >
Internet Message Format  |  1990-12-28  |  9KB

  1. From: philc@sco.COM (Jimi Hendrix)
  2. Newsgroups: alt.sources
  3. Subject: MAD magazine rock concert story program
  4. Message-ID: <8606@scorn.sco.COM>
  5. Date: 1 Aug 90 17:22:45 GMT
  6.  
  7.  
  8.  
  9. /*--------------------------------------------------------------- 
  10.           C implementation of MAD magazine's 
  11.  
  12.         ALL-INCLUSIVE DO-IT-YOURSELF 
  13.                ROCK CONCERT
  14.               Newspaper Story
  15.  
  16.               by
  17.  
  18.           satyr@ucscb.ucsc.edu            1987
  19. ------------------------------------------------------------------*/
  20. #include <stdio.h>
  21. #define when break;case
  22.  
  23. main ()
  24. {
  25.     char *w1, *w2, *w3, *w4, *w5; 
  26.     char *w6, *w7, *w8, *w9, *w10;
  27.     char *w11, *w12, *buf, *malloc();
  28.     int  flag, mark, x, i;
  29.  
  30.     srand(getpid());
  31.  
  32.     buf = malloc(BUFSIZ);
  33.  
  34.     switch (rand() % 12)
  35.     {
  36.         case 0 : sprintf(buf, "Thousands of");
  37.         when 1 : sprintf(buf, "Millions of");
  38.         when 2 : sprintf(buf, "Hundreds of");
  39.         when 3 : sprintf(buf, "Several");
  40.         when 4 : sprintf(buf, "Uncounted millions of");
  41.          when 5 : sprintf(buf, "Fourteen");
  42.         when 6 : sprintf(buf, "A huge number of");
  43.         when 7 : sprintf(buf, "Billions of");
  44.         when 8 : sprintf(buf, "Seven and a half");
  45.         when 9 : sprintf(buf, "Many");
  46.         when 10 : sprintf(buf, "Quite a few");
  47.         when 11 : sprintf(buf, "More than one");
  48.         break;
  49.     }
  50.     strcat(buf, " ");
  51.  
  52.     switch (rand() % 12)
  53.     {
  54.         case 0 : strcat(buf, "screaming");
  55.         when 1 : strcat(buf, "ripped-off");
  56.         when 2 : strcat(buf, "born-again");
  57.         when 3 : strcat(buf, "Bloom County");
  58.         when 4 : strcat(buf, "suicidal");
  59.          when 5 : strcat(buf, "toxic");
  60.         when 6 : strcat(buf, "whacked-out");
  61.         when 7 : strcat(buf, "slightly used");
  62.         when 8 : strcat(buf, "pregnant");
  63.         when 9 : strcat(buf, "molting");
  64.         when 10 : strcat(buf, "frigid");
  65.         when 11 : strcat(buf, "calcium deficient");
  66.         break;
  67.     }
  68.  
  69.     strcat(buf, " ");
  70.     switch (rand() % 12)
  71.     {
  72.         case 0 : strcat(buf, "rock fans");
  73.         when 1 : strcat(buf, "teenagers");
  74.         when 2 : strcat(buf, "marmot-breeders");
  75.         when 3 : strcat(buf, "Sandanistas");
  76.         when 4 : strcat(buf, "Bob Uecker look-alikes");
  77.          when 5 : strcat(buf, "boat people");
  78.         when 6 : strcat(buf, "amnesiacs");
  79.         when 7 : strcat(buf, "Trivial Pursuit players");
  80.         when 8 : strcat(buf, "owl worshippers");
  81.         when 9 : strcat(buf, "bed-wetters");
  82.         when 10 : strcat(buf, "Delorean dealers");
  83.         when 11 : strcat(buf, "soothsayers");
  84.         break;
  85.     }
  86.     strcat(buf, " packed ");
  87.  
  88.     switch (rand() % 12)
  89.     {
  90.         case 0 : strcat(buf, "the City Auditorium");
  91.         when 1 : strcat(buf, "the Kingdome");
  92.         when 2 : strcat(buf, "Bernie's Car Wash");
  93.         when 3 : strcat(buf, "St Patrick's Cathedral");
  94.         when 4 : strcat(buf, "the Oval Office");
  95.          when 5 : strcat(buf, "Buddy Hackett's hot tub");
  96.         when 6 : strcat(buf, "the Australian outback");
  97.         when 7 : strcat(buf, "a new Honda Civic");
  98.         when 8 : strcat(buf, "Ted and Rita's family room");
  99.         when 9 : strcat(buf, "the K Mart linens section");
  100.         when 10 : strcat(buf, "Lake Huron");
  101.         when 11 : strcat(buf, "the Exit 17 offramp");
  102.         break;
  103.     }
  104.  
  105.     strcat(buf, " last night to see ");
  106.     switch (rand() % 12)
  107.     {
  108.         case 0 : strcat(buf, "the Jacksons");
  109.         when 1 : strcat(buf, "Van Halen");
  110.         when 2 : strcat(buf, "Boy George");
  111.         when 3 : strcat(buf, "the Little Rascals");
  112.         when 4 : strcat(buf, "Kate and Allie");
  113.          when 5 : strcat(buf, "Botswana wife-swappers");
  114.         when 6 : strcat(buf, "the Dallas Mavericks");
  115.         when 7 : strcat(buf, "Mr T's caterer");
  116.         when 8 : strcat(buf, "the Miss Bulgaria finalists");
  117.         when 9 : strcat(buf, "the last Civil War veteran");
  118.         when 10 : strcat(buf, "Casper Weinberger");
  119.         when 11 : strcat(buf, "a KGB double agent");
  120.         break;
  121.     }
  122.     strcat(buf, " in concert.  Many fans ");
  123.     switch (rand() % 12)
  124.     {
  125.         case 0 : strcat(buf, "stood in line");
  126.         when 1 : strcat(buf, "counted their toes");
  127.         when 2 : strcat(buf, "shouted pygmy oaths");
  128.         when 3 : strcat(buf, "chanted \"DEE-fense!\"");
  129.         when 4 : strcat(buf, "aged prematurely");
  130.          when 5 : strcat(buf, "licked Snickers wrappers");
  131.         when 6 : strcat(buf, "donned wet suits");
  132.         when 7 : strcat(buf, "polished their nose-rings");
  133.         when 8 : strcat(buf, "wept openly");
  134.         when 9 : strcat(buf, "broke wind");
  135.         when 10 : strcat(buf, "swapped zip codes");
  136.         when 11 : strcat(buf, "fondled their ear lobes");
  137.     }
  138.  
  139.     strcat(buf, " for more than ten hours while waiting to ");
  140.     switch (rand() % 12)
  141.     {
  142.         case 0 : strcat(buf, "pay $30");
  143.         when 1 : strcat(buf, "sell their sisters");
  144.         when 2 : strcat(buf, "grovel shamelessly");
  145.         when 3 : strcat(buf, "lose their virginity");
  146.         when 4 : strcat(buf, "renounce Satan");
  147.          when 5 : strcat(buf, "give up breathing");
  148.         when 6 : strcat(buf, "sacrifice a beagle");
  149.         when 7 : strcat(buf, "betray their scoutmaster");
  150.         when 8 : strcat(buf, "sell their vital organs");
  151.         when 9 : strcat(buf, "give up their citizenship");
  152.         when 10 : strcat(buf, "pawn their phony Omegas");
  153.         when 11 : strcat(buf, "change their sex");
  154.         break;
  155.     }
  156.  
  157.     strcat(buf, " for a ticket.  Despite ");
  158.     switch (rand() % 12)
  159.     {
  160.         case 0 : strcat(buf, "a few outbreaks of");
  161.         when 1 : strcat(buf, "the usual");
  162.         when 2 : strcat(buf, "some harmless");
  163.         when 3 : strcat(buf, "post-Olympic");
  164.         when 4 : strcat(buf, "sloppy attempts at");
  165.          when 5 : strcat(buf, "authentic Haitian");
  166.         when 6 : strcat(buf, "precision drill");
  167.         when 7 : strcat(buf, "the romantic lure of");
  168.         when 8 : strcat(buf, "the Reagan Cabinet's");
  169.         when 9 : strcat(buf, "some very creative");
  170.         when 10 : strcat(buf, "the lethal effects of");
  171.         when 11 : strcat(buf, "the distinctive odor of");
  172.         break;
  173.     }
  174.     strcat(buf, " ");
  175.     switch (rand() % 12)
  176.     {
  177.         case 0 : strcat(buf, "rioting");
  178.         when 1 : strcat(buf, "terrorism");
  179.         when 2 : strcat(buf, "drunkenness");
  180.         when 3 : strcat(buf, "car-stripping");
  181.         when 4 : strcat(buf, "pillaging");
  182.          when 5 : strcat(buf, "nude break-dancing");
  183.         when 6 : strcat(buf, "possum worship");
  184.         when 7 : strcat(buf, "Karl Malden impersonations");
  185.         when 8 : strcat(buf, "silicone rejection");
  186.         when 9 : strcat(buf, "out-of-body retching");
  187.         when 10 : strcat(buf, "estate planning");
  188.         when 11 : strcat(buf, "parakeet training");
  189.         break;
  190.     }
  191.  
  192.     strcat(buf, " and the occasional ");
  193.     switch (rand() % 12)
  194.     {
  195.         case 0 : strcat(buf, "arrest");
  196.         when 1 : strcat(buf, "flogging");
  197.         when 2 : strcat(buf, "hearing loss");
  198.         when 3 : strcat(buf, "death screams");
  199.         when 4 : strcat(buf, "melt-down");
  200.          when 5 : strcat(buf, "spraying");
  201.         when 6 : strcat(buf, "flossing");
  202.         when 7 : strcat(buf, "glassy-eyed stares");
  203.         when 8 : strcat(buf, "pre-soaking");
  204.         when 9 : strcat(buf, "poor penalty-killing");
  205.         when 10 : strcat(buf, "factory recall");
  206.         when 11 : strcat(buf, "painless removal");
  207.         break;
  208.     }
  209.     strcat(buf, " of ");
  210.  
  211.     switch (rand() % 12)
  212.     {
  213.         case 0 : strcat(buf,  "unruly");
  214.         when 1 : strcat(buf,  "off-duty");
  215.         when 2 : strcat(buf,  "stoned");
  216.         when 3 : strcat(buf,  "pre-Columbian");
  217.         when 4 : strcat(buf,  "singles-bar");
  218.          when 5 : strcat(buf,  "fur-bearing");
  219.         when 6 : strcat(buf,  "Lucasfilm");
  220.         when 7 : strcat(buf,  "Libyan-backed");
  221.         when 8 : strcat(buf,  "reincarnated");
  222.         when 9 : strcat(buf,  "moss-covered");
  223.         when 10 : strcat(buf,  "cutesy-pie");
  224.         when 11 : strcat(buf,  "splattered");
  225.         break;
  226.     }
  227.     strcat(buf, " ");
  228.     switch (rand() % 12)
  229.     {
  230.         case 0 : strcat(buf, "punks");
  231.         when 1 : strcat(buf, "drug dealers");
  232.         when 2 : strcat(buf, "Sagittarians");
  233.         when 3 : strcat(buf, "nerds");
  234.         when 4 : strcat(buf, "welfare cheats");
  235.          when 5 : strcat(buf, "Unitarians");
  236.         when 6 : strcat(buf, "surfers");
  237.         when 7 : strcat(buf, "mercenaries");
  238.         when 8 : strcat(buf, "Cornhuskers");
  239.         when 9 : strcat(buf, "skycaps");
  240.         when 10 : strcat(buf, "Munchkins");
  241.         when 11 : strcat(buf, "centerfolds");
  242.         break;
  243.     }
  244.     
  245.     strcat(buf, ", the promoters of the event called it ");
  246.     switch (rand() % 12)
  247.     {
  248.         case 0 : strcat(buf,  "an unqualified success.");
  249.         when 1 : strcat(buf,  "a victory for good taste.");
  250.         when 2 : strcat(buf,  "more fun than Pearl Harbor.");
  251.         when 3 : strcat(buf,  "a vindication of greed.");
  252.         when 4 : strcat(buf,  "proof of God's love.");
  253.          when 5 : strcat(buf,  "an incredible waste of time.");
  254.         when 6 : strcat(buf,  "as significant as Flag Day.");
  255.         when 7 : strcat(buf,  "a triumph for Jerry Falwell.");
  256.         when 8 : strcat(buf,  "a glorification of self-abuse.");
  257.         when 9 : strcat(buf,  "as memorable as 'Lottery'.");
  258.         when 10 : strcat(buf,  "a festival for degenerates.");
  259.         when 11 : strcat(buf,  "an answer for Communism.");
  260.         break;
  261.     }
  262.  
  263.     printf("                         MAD Magazine\n");
  264.     printf("-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_\n");
  265.     printf("                    ROCK CONCERT LAST NIGHT\n\n");
  266.  
  267.         /* this is gross, dont look */
  268.     x = 70;
  269.     mark = 0;
  270. gack:    
  271.     if (!flag)
  272.         if (buf[x] != ' ')
  273.             while (buf[x--] != ' ')
  274.                 ;
  275.  
  276.     for (i=mark;i<x+1;i++) {
  277.         if ( (mark == i) && (buf[i] == ' ') ) continue;
  278.         putchar(buf[i]);
  279.     }
  280.     putchar('\n');
  281.  
  282.     if (flag) 
  283.          putchar('\n'), exit(0);
  284.     
  285.     mark = x + 1;
  286.     x = mark + 71;
  287.     if (x >= strlen(buf)) {     
  288.         x = strlen(buf);
  289.         flag++;
  290.     }
  291.     goto gack;
  292.  
  293.  
  294.     for (i=0;i<BUFSIZ;i++) {
  295.         if ( ((i % 72) == 0) && (buf[i] == ' ') ) continue;
  296.         putchar(buf[i]);
  297.         if ( (i != 0) && ((i % 71) == 0) )
  298.             putchar('\n');
  299.     }
  300.     putchar('\n');
  301. }
  302. -- 
  303.                    philc@sco.COM  -=- uunet!sco!philc
  304. curses! may you be forced to grep the termcap of an unclean yacc while a herd
  305. of wild rogue emacs fsck your troff and vgrind your pathalias!
  306.