home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume2 / c_puns < prev    next >
Internet Message Format  |  1991-08-07  |  4KB

  1. From: mjs@tropix.UUCP (Michael J Shon)
  2. Newsgroups: comp.sources.misc
  3. Subject: v02i099: a little joke in C
  4. Message-ID: <303@tropix.UUCP>
  5. Date: 18 Apr 88 19:35:35 GMT
  6. Approved: allbery@ncoast.UUCP
  7.  
  8. comp.sources.misc: Volume 2, Issue 99
  9. Submitted-By: "Michael J Shon" <mjs@tropix.UUCP>
  10. Archive-Name: c_puns
  11.  
  12. Well...
  13. I lost my mind one day when I saw a piece of code like
  14.     long time();    /* know C */
  15. and this was the result.  I think that it lints ok. (I haven't really checked)
  16. It compiles and runs, but it's really intended for very careful reading.
  17. (I like to think that there are a few subtle jokes in it.)
  18.                     mike shon  
  19. ---------------------------cut here------------------------------------------
  20. /*
  21.  * find the important things in Life, the Universe, and Everything
  22.  */
  23.  
  24. typedef short    some;        /* some things are short */
  25. typedef some    very;        /* some things are very short */
  26.  
  27. #define A            /* The first letter of the English Alphabet */
  28. #define LINE    2        /* 2 points define a line */
  29.  
  30. #define TRUTH    BEAUTY        /* truth is beauty */
  31. #define BEAUTY    10        /* and beauty is a 10 */
  32.  
  33. #define bad    char        /* burnt on both sides */
  34. #define old    char        /* the great Chicago Fire */
  35.  
  36. #define    get    strlen        /* during your life, try to get some sterling */
  37. #define youmake    float        /* you make it, I'll drink it */
  38.  
  39.  
  40. #define        yourgoals    in terms you can understand
  41. /*
  42. #include    "yourdreams"    /* for the future */
  43.  
  44.  
  45.     /* everyone needs goals */
  46.  
  47. short    term;
  48. double    yourpleasure();
  49. double    yourfun;
  50.  
  51. long    Term, play(), agame;
  52.  
  53.     /* everyone needs diversions */
  54.  
  55. old *joke = "Why did the chicken cross the road?\n\tTo get to the other side!\n\t\tWocka Wocka Wocka!\n"; 
  56.     
  57.  
  58. tell(joke)
  59. bad    *joke;        /* wait- you haven't heard it yet! */
  60. {
  61.     short laugh;    /* please */
  62.  
  63.     laugh = get(joke);
  64.     write(1, joke, laugh);    /* write it down- don't say it */
  65.  
  66. }
  67.  
  68.     /* most folks like music */
  69.  
  70. long play(record)
  71. long record;
  72. {
  73.     very pleasant = TRUTH;        /* if you like music */
  74.  
  75.     while (record == pleasant)
  76.         play(record--);
  77.  
  78.     return( pleasant );        /* music soothes the savage */
  79. }
  80.  
  81.  
  82. double    yourpleasure(one, way)        /* this is necessary if */
  83. some    one;                /* is watching ,or if you have a */
  84. long    way;                /* to go  */
  85. {
  86.         /* this can change one while maintaining one's identity */
  87.     one = one * one;  
  88.     return( one );        /* after all, it should have at least doubled */
  89. }
  90.  
  91. hold(temper)            /* good advice */
  92. A short temper;            /* is a dangerous thing */
  93. {
  94.     A long    time;        /* is what you need */
  95.     very calm;        /* is how you should be */
  96.  
  97.     calm = temper, temper;
  98.  
  99.     while (calm--)
  100.         wait(&time);
  101.  
  102.     return(calm);        /* if possible */
  103. }
  104.  
  105.  
  106.     /* now, on to the main thing */
  107.  
  108. main(thing, mustbe)        /* to balance work, play, and goals */
  109. some thing, mustbe;        /* important, or we wouldn't be here */
  110. {
  111.  
  112.     long    time();        /* know C */
  113.     very    bored;        /* the result of too few goals */
  114.  
  115.     short    hours;        /* make */
  116.     long    yourwork;    /* which makes for */
  117.     short    tempers;    /* which can be improved by */
  118.     long    laughing;
  119.  
  120.  
  121.     /* first, set priorities */
  122.     yourwork = 0;
  123.     yourfun = 1.0e+38;
  124.  
  125.     if (yourpleasure( mustbe, yourwork ))
  126.         yourfun = yourwork;
  127.     else
  128.         yourfun = play( agame );
  129.  
  130.     bored = yourfun - yourwork;      /* nothing to do? */
  131.                     /* reach out and touch someone! */
  132.  
  133.     switch ( bored ) {    /* connects all of this together */
  134.     default:
  135.         hours = hold(LINE); /* no way to avoid it, take a */
  136.         break;
  137.     }
  138.  
  139.         /* take a music break */
  140.     while ( thing-- ) {    /* you make my heart sing */
  141.         youmake everything;
  142.         very groovy;
  143.     }
  144.  
  145.         /* focus on what is important to you */
  146.     while ( yourfun < 0 ) {
  147.         yourpleasure( mustbe, agame);
  148.         yourfun = play( agame );
  149.     }
  150.  
  151.     tell(joke);
  152.  
  153.     exit( laughing );
  154. }
  155.