"bozo" program script
Chuck Sites
chuck at coplex.UUCP
Sat Jul 22 17:23:35 AEST 1989
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 <stdio.h>
#include <time.h>
#endif
#ifdef BSD_4_2
#undef PERIOD_VAL
#define PERIOD_VAL 46
#include <stdio.h>
#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; i<argc-1; i++)
fprintf(bozoerr,"%s - Not applicable\n",argv[i]);
fprintf(bozoerr,"\n");
}
else
{
if ((bozofile = fopen(bozofilename,"a"))==NULL) {
fprintf(bozoerr,"Bozo error.\n");
fprintf(bozoerr,"There is a problem with the bozolog file.\n");
fprintf(bozoerr,"Contact your system administrator to resolve the problem\n");
exit(1);
}
bozo_username = (char *)getlogin();
current_time = time((long *) 0);
bozo_time = (char *)ctime(¤t_time);
bozo_tty= (char *)ttyname(0);
fprintf(bozofile,"%s %s\n%s\n",bozo_username,bozo_tty,bozo_time);
fclose(bozofile);
fprintf(bozoout,"%s: Checking to see if your a bozo or not.\n",argv[0]);
for (i=0; i<DEFAULT_PERIOD_COUNT; i++) {
sleep(1);
putc(PERIOD_VAL,bozoout);
fflush(bozoout);
}
sleep(1);
fprintf(bozoout,"\n%s: You are a bozo!\n",argv[0]);
}
#else
#ifndef MSDOS
if (strcmp(argv[0],"bozo") != 0 ) {
fprintf(bozoerr,"Bozo error.\n");
exit(1);
}
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; i<argc-1; i++)
fprintf(bozoerr,"%s - Not applicable\n",argv[i]);
fprintf(bozoerr,"\n");
}
else
{
fprintf(bozoout,"%s: Checking to see if your a bozo or not.\n",argv[0]);
for (i=0; i<DEFAULT_PERIOD_COUNT; i++) {
sleep(1);
putc(PERIOD_VAL,bozoout);
fflush(bozoout);
}
sleep(1);
fprintf(bozoout,"\n%s: You are a bozo!\n",argv[0]);
}
#else
fprintf(bozoerr,"Bozo error. Bad OS\n");
#endif
#endif
}
SHAR_EOF
fi # end of overwriting check
# End of shell archive
exit 0
-------- Cunt Hair ------ Cunt Hair ------ Opps, I mean 'CUT HERE' ---
________
### ## _/ \
##O # / BOZO \
o # /__ TODAY! /
##### # / \________/
o #
#| #
#| ##
------------------------------------------------------------------------------
. . . Chuck Sites | mit-eddie!bloom-beacon!coplex!chuck . . .
o o o o chuck at coplex | ATT: (502)-454-7218 WRK: 968-8495 o o o o
O O O O O May several drugged lammas have a party in you kitchen. O O O O O
------------------------------------------------------------------------------
More information about the Alt.sources
mailing list