Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site ubc-vision.CDN Path: utzoo!utcsri!ubc-vision!majka From: majka@ubc-vision.CDN (Marc Majka) Newsgroups: net.jokes Subject: Joke Generator Message-ID: <936@ubc-vision.CDN> Date: Sat, 4-May-85 16:51:04 EDT Article-I.D.: ubc-visi.936 Posted: Sat May 4 16:51:04 1985 Date-Received: Sat, 4-May-85 20:42:50 EDT Organization: UBC Computational Vision Lab, Vancouver, B.C., Canada Lines: 145 The ULTIMATE in jokes: the Joke Generator! This program will entertain you with hours of fun and enjoyment. Just run the following shell archive thorough sh (not csh). Then type "joke" for an original joke! No more dull variations on the same LBJs you have grown to detest. No more stale JAP jokes. This program will supply you with a new joke every time. With this program, you don't even need to read net.jokes anymore! --- Marc Majka - UBC Laboratory for Computational Vision ****** CUT ***** CUT ***** CUT ***** CUT ***** CUT ***** CUT ***** CUT ***** # # shell archive - extract files with /bin/sh # set CSHOUT1 = 'echo Extract with sh not csh' set CSHOUT2 = 'exit 1' $CSHOUT1 $CSHOUT2 echo extracting file joke.c sed 's/^X//' > joke.c <<'!FUNKY!STUFF!' X#define MAXT 20 X Xmain(argc,argv) Xint argc; Xchar *argv[]; X{ X long random(); X int people, action, things, total, first, rest, np, na, nt; X char plist[100][32], alist[100][32], tlist[100][32]; X X np = 0; X strcpy(plist[np++],""); X strcpy(plist[np++],"Doctors"); X strcpy(plist[np++],"JAPs"); X strcpy(plist[np++],"Lawyers"); X strcpy(plist[np++],"Martians"); X strcpy(plist[np++],"Newfoundlanders"); X strcpy(plist[np++],"Programmers"); X strcpy(plist[np++],"Students"); X strcpy(plist[np++],"Yuppies"); X strcpy(plist[np++],"Zen Masters"); X strcpy(plist[np++],"Politicians"); X strcpy(plist[np++],"DEC repairmen"); X strcpy(plist[np++],"Russians"); X strcpy(plist[np++],"Americans"); X strcpy(plist[np++],"Canadians"); X strcpy(plist[np++],"Nuns"); X strcpy(plist[np++],"Priests"); X strcpy(plist[np++],"Professors"); X strcpy(plist[np++],"Californians"); X X X na = 0; X strcpy(alist[na++],"build"); X strcpy(alist[na++],"call"); X strcpy(alist[na++],"change"); X strcpy(alist[na++],"cook"); X strcpy(alist[na++],"eat"); X strcpy(alist[na++],"fix"); X strcpy(alist[na++],"fly"); X strcpy(alist[na++],"make"); X strcpy(alist[na++],"move"); X strcpy(alist[na++],"play"); X strcpy(alist[na++],"watch"); X strcpy(alist[na++],"tell"); X strcpy(alist[na++],"love"); X strcpy(alist[na++],"kill"); X strcpy(alist[na++],"pick"); X strcpy(alist[na++],"climb"); X strcpy(alist[na++],"write"); X strcpy(alist[na++],"save"); X strcpy(alist[na++],"shop"); X strcpy(alist[na++],"find"); X X X nt = 0; X strcpy(tlist[nt++],"VAX"); X strcpy(tlist[nt++],"IBM PC"); X strcpy(tlist[nt++],"telephone"); X strcpy(tlist[nt++],"subroutine"); X strcpy(tlist[nt++],"house"); X strcpy(tlist[nt++],"thesis"); X strcpy(tlist[nt++],"nose"); X strcpy(tlist[nt++],"Grizzly Bear"); X strcpy(tlist[nt++],"light bulb"); X strcpy(tlist[nt++],"birthday cake"); X strcpy(tlist[nt++],"flat tire"); X strcpy(tlist[nt++],"trumpet"); X strcpy(tlist[nt++],"movie"); X strcpy(tlist[nt++],"airplane"); X strcpy(tlist[nt++],"book"); X strcpy(tlist[nt++],"TV show"); X strcpy(tlist[nt++],"Lisp program"); X strcpy(tlist[nt++],"C program"); X strcpy(tlist[nt++],"Fortran program"); X strcpy(tlist[nt++],"cat"); X strcpy(tlist[nt++],"hockey game"); X strcpy(tlist[nt++],"dog"); X strcpy(tlist[nt++],"fish"); X strcpy(tlist[nt++],"UNIX system"); X strcpy(tlist[nt++],"video game"); X strcpy(tlist[nt++],"baseball bat"); X strcpy(tlist[nt++],"Lightbulb joke"); X strcpy(tlist[nt++],"frog"); X strcpy(tlist[nt++],"compiler"); X strcpy(tlist[nt++],"nuclear bomb"); X strcpy(tlist[nt++],"cruise missile"); X strcpy(tlist[nt++],"tree"); X strcpy(tlist[nt++],"whale"); X X srandom (getpid()); X X people = random() % np; X action = random() % na; X things = random() % nt; X X printf ("How many %s does it take to %s a %s?\n", X plist[people],alist[action],tlist[things]); X X total = 1 + (random() % MAXT); X first = 1 + (random() % total); X rest = total - first; X X action = random() % na; X things = random() % nt; X X if (total == 1) printf ("Just one. Why should it take any more?\n"); X else { X printf ("%d. %d to %s the %s, ", X total,first,alist[action],tlist[things]); X X action = random() % na; X things = random() % nt; X X printf ("and %d to %s the %s.\n",rest,alist[action],tlist[things]); X } X X exit(0); X} !FUNKY!STUFF! echo compiling your joke generator cc -o joke joke.c echo Done\! Type joke for a funny joke\! exit 0