Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!shelby!decwrl!ucbvax!bloom-beacon!coplex!chuck From: chuck@coplex.UUCP (Chuck Sites) Newsgroups: alt.sources Subject: Re: "bozo" program script Summary: Now BOZO in C! Yes you too can bozo in C Message-ID: <748@coplex.UUCP> Date: 22 Jul 89 07:23:35 GMT References: <6145@rpi.edu> Distribution: alt Organization: Copper Electronics, Louisville, Ky. Lines: 223 This is our version of the BOZO program. We have painstakenly translated the entire look and feel of of the original bozo program. It has taken us hour, days, no.. months.. no actually several centuries for 1000 monkeys typing on a keyboard randomly, to reverse engineer the original program. It may contain some bugs, but if you find any, we don't even want to know what they are. After unsharing.. compile..link..run..edit..compile.. link..run..edit.. as usual. ----- Cunt Hair ---- Cunt Hair ----- Cunt Hair ----- Cunt Hair ----- #! /bin/sh # This is a shell archive, meaning: # 1. Remove everything above the #! /bin/sh line. # 2. Save the resulting text in a file. # 3. Execute the file with /bin/sh (not csh) to create the files: # bozo.c # This archive created: Sat Jul 22 01:33:46 1989 export PATH; PATH=/bin:$PATH if test -f 'bozo.c' then echo shar: will not over-write existing file "'bozo.c'" else cat << \SHAR_EOF > 'bozo.c' /* bozo -- Interactive Intelligent Bozo Identification Protocol */ /* Credits: Originally written in Pascal for MTS by Todd McComb Translated to UNIX script by James "Kibo" Parry 6/22/89 Enhanced by James "Kibo" Parry 7/20/89 Translated to 41,593 lines of Pseudo code by Dean Brooks 7/20/89 Pseudo code transcribed to FORTH by Chuck Sites 7/20/89 4:23PM FORTH code scrapped for lack of legibility 7/20/89 4:24PM Pseudo code processed into C code by Dannie Gregoire & Chuck Sites C Code compiled and linked on CRAY supercomputer for performance tests C Code released to the public by Dean Brooks, Chuck Sites and Dannie Gregoire on 7/21/89 */ /* Enhancements and improvements: * 1. Better error handling. * 2. Increased Performance. We estimate it's about 20% faster than * the original PASCAL version, although we don't have pascal to * compile the original code, (nor do we want it), we beleive our * estimate is pretty accurate. Compared to the UNIX Shell version, * We believe there is substantial performance increase. * 3. Increased portability. * 4. A Better user interface. * * FUTURE Improvements: * Design a networked bozo. Yes you to can bozo across the world! * We are currently working very hard to implement this feature so * that the file /home/m/kibo/.bozolog on James "kibo" Perry machine * will have every bozo transaction in the world! However, we are * still trying to decide the networking protocal to use. */ /* Configure to the default syntactical terminator count */ #define DEFAULT_PERIOD_COUNT 9 /* Define one below depending on target operating system */ /* Extreme pains were involved to insure that this protocol */ /* would perform as exceptionally as the original PASCAL version. */ /* This program should compile on all below systems. */ #define USG /* #define BSD_4_2 */ /* #define BSD_4_3 */ /* #define SUN */ /* #define AMIGA */ /* #define IBM_PC */ /* #define TRASH_80 */ /* #define EUNICE */ /* #define UNIVAC */ /* #define ENIAC */ /* #define TI_994A */ /* #define VIC_20 */ /* #define SEARS_GARAGE_DOOR_OPENER */ /* #define ADAM */ /* #define SINCLAIR */ /* #define DAVID_FOOBINSTIENS_VCR */ /* NOTE: MS-DOS was excluded because of the difficulty in porting code to it * However, I understand that with modifications, the define for CPM * may work. However, this has not been tested since none of our beta * testers use MS-DOS without being coersed to do so by a large Himalayan * yetti standing on the back of a wild Holstein cow singing "Wild Thing". * Needless to say this doesn't happen often. */ /* #define CPM */ #define PERIOD_VAL '.' #ifdef USG #undef PERIOD_VAL #define PERIOD_VAL '.' #include #include #endif #ifdef BSD_4_2 #undef PERIOD_VAL #define PERIOD_VAL 46 #include #endif #ifdef SEARS_GARAGE_DOOR_OPENER #undef PERIOD_VAL #define PERIOD_VAL 0x2e /* May not work on door openers over model 7 rev 2 */ #endif char bozofilename[]="/tmp/.bozolog"; main(argc,argv) int argc; char *argv[]; { int i; FILE *bozofile; FILE *bozoerr; FILE *bozoout; char *bozo_username; char *bozo_tty; char *bozo_time; long current_time; bozoerr = stderr; bozoout = stdout; #ifdef USG #ifndef MSDOS if (strcmp(argv[0],"bozo") != 0 ) { fprintf(bozoerr,"Bozo error.\n"); exit(1); } #else fprintf(bozoerr,"Bozo error.\n"); fprintf(bozoerr,"Panic: O/S confused."); exit(0); #endif if (argc>1) { fprintf(bozoerr,"No arguments expected or wanted.\n"); fprintf(bozoerr,"So why did you add these extra words when you ran %s\n",argv[0]); fprintf(bozoerr,"Here is a list of the extra ones you added when running %s:\n",argv[0]); for (i=1; i1) { fprintf(bozoerr,"No arguments expected or wanted.\n"); fprintf(bozoerr,"So why did you add these extra words when you ran %s\n",argv[0]); fprintf(bozoerr,"Here is a list of the extra ones you added when running %s:\n",argv[0]); for (i=1; i