Path: utzoo!utgpu!cs.utexas.edu!swrinde!mips!pacbell.com!tandem!zorch!xanthian From: xanthian@zorch.SF-Bay.ORG (Kent Paul Dolan) Newsgroups: alt.sources Subject: A brief history of Pepe Keywords: bad joke, ascii graphics, K&R C, csh dependent, hit "n" now Message-ID: <1990Dec31.044356.4672@zorch.SF-Bay.ORG> Date: 31 Dec 90 04:43:56 GMT Sender: xanthian@zorch.SF-Bay.ORG (Kent Paul Dolan) Followup-To: alt.sources.d Organization: SF-Bay Public-Access Unix Lines: 403 This is absolute drivel of no redeeming value whatsoever; it is dependent on csh, uses pre-ANSI C, contains five C programs that should have been one and differ among themselves in only a few lines, has a shell script instead of a makefile, is tediously slow, displays a bubblesort in a loop that would gag a maggot, and produces a product of limited if any value, a poor attempt at a joke. That's why I let the net pay for transporting it all around the world. The pathetic excuse for doing this, and another copy of the same boring code, along with the nauseatingly repetitious ASCII graphic output, is in talk.bizarre. Notice how nicely Rich Salz' cshar packed it up, though. Kent, the man from xanth. #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'MANIFEST' <<'END_OF_FILE' X File Name Archive # Description X----------------------------------------------------------- X MANIFEST 1 This shipping list X README 1 X lookoutpepe 1 X makepepe 1 X pepebacksort.c 1 X pepebarezap.c 1 X pepedata 1 X pepesort.c 1 X pepeunsort.c 1 X pepezap.c 1 END_OF_FILE if test 424 -ne `wc -c <'MANIFEST'`; then echo shar: \"'MANIFEST'\" unpacked with wrong size! fi # end of 'MANIFEST' fi if test -f 'README' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'README'\" else echo shar: Extracting \"'README'\" \(399 characters\) sed "s/^X//" >'README' <<'END_OF_FILE' XThis stuff is ugly as sin, and lookoutpepe is csh dependent besides, Xbut if you insist, unpack it and type makepepe. The C code is Xnothing to write home to Mom about; it's pre-ANSI C, and it's Xrepetitive as hell. Still, if you're into pain, take a look. XYep, that's a bubblesort in there; sue me for your money back. X XKent, the man from xanth. X END_OF_FILE if test 399 -ne `wc -c <'README'`; then echo shar: \"'README'\" unpacked with wrong size! fi # end of 'README' fi if test -f 'lookoutpepe' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'lookoutpepe'\" else echo shar: Extracting \"'lookoutpepe'\" \(1205 characters\) sed "s/^X//" >'lookoutpepe' <<'END_OF_FILE' X#! /bin/csh Xcp /dev/null pepehistory Xecho "-----" >> pepehistory Xecho "Pepe\! Look out\!" >> pepehistory Xecho "Oops\!" >> pepehistory Xecho "-----" >> pepehistory Xpepezap 512 < pepedata >> pepehistory Xecho "Could we see that on slo-mo replay, please?" >> pepehistory Xecho "-----" >> pepehistory Xforeach i (1 2 4 8 16 32 64 128 256 512) Xpepezap $i < pepedata >> pepehistory Xend Xecho "Don't despair Pepe, we can sort that right out\!" >> pepehistory Xecho "-----" >> pepehistory Xpepesort 63 < pepedata >> pepehistory Xecho "Damn\! That didn't work; have to try it the hard way\!" >> pepehistory Xecho "Zzzzzzt\!" >> pepehistory Xecho "-----" >> pepehistory Xpepezap 512 < pepedata >> pepehistory Xecho "Shuffle to the left\!" >> pepehistory Xecho "Shuffle to the right\!" >> pepehistory Xecho "Shuffle poor Pepe\!" >> pepehistory Xecho "Fight\! Fight\! Fight\!" >> pepehistory Xecho "-----" >> pepehistory Xforeach i (9 18 27 36 45 54) Xpepebarezap 512 < pepedata | pepebacksort $i >> pepehistory Xend Xecho "Now the other way\!" >> pepehistory Xecho "-----" >> pepehistory Xforeach i (63 60 57 54 51 48 45 42 39 36 27 18 9 0) Xpepeunsort $i < pepedata >> pepehistory Xend Xecho "All better\!" >> pepehistory Xcat pepehistory END_OF_FILE if test 1205 -ne `wc -c <'lookoutpepe'`; then echo shar: \"'lookoutpepe'\" unpacked with wrong size! fi chmod +x 'lookoutpepe' # end of 'lookoutpepe' fi if test -f 'makepepe' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'makepepe'\" else echo shar: Extracting \"'makepepe'\" \(211 characters\) sed "s/^X//" >'makepepe' <<'END_OF_FILE' X#!/bin/sh X# X# you try living with a broken "make"! X# Xcc -o pepezap pepezap.c Xcc -o pepesort pepesort.c Xcc -o pepebarezap pepebarezap.c Xcc -o pepebacksort pepebacksort.c Xcc -o pepeunsort pepeunsort.c Xlookoutpepe END_OF_FILE if test 211 -ne `wc -c <'makepepe'`; then echo shar: \"'makepepe'\" unpacked with wrong size! fi chmod +x 'makepepe' # end of 'makepepe' fi if test -f 'pepebacksort.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pepebacksort.c'\" else echo shar: Extracting \"'pepebacksort.c'\" \(888 characters\) sed "s/^X//" >'pepebacksort.c' <<'END_OF_FILE' X#include Xmain(argc,argv) Xint argc; Xchar *argv[]; X{ X int c,pepeindex,swaptemp,i,j,sortpasses; X int pepebuffer[81]; X int line = 0; X if (argc != 2) X { X printf("usage: pepebacksort sortpasses < pepefile > sortedpepefile\n"); X exit(1); X } X sscanf(argv[1],"%d",&sortpasses); X pepeindex=0; X printf("pepebacksort after %3d sort passes\n",sortpasses); X while ((c = getchar()) != EOF) X { X pepebuffer[pepeindex++] = c; X if (c == (int)'\n') X { X for (i=0;i'pepebarezap.c' <<'END_OF_FILE' X#include Xmain(argc,argv) Xint argc; Xchar *argv[]; X{ X int c,pepeindex,swaptemp,swapfrom,swapto,i,nanoseconds; X int pepebuffer[81]; X int line = 0; X if (argc != 2) X { X printf("usage: pepebarezap nanoseconds < pepefile > zappedpepefile\n"); X exit(1); X } X sscanf(argv[1],"%d",&nanoseconds); X pepeindex=0; X while ((c = getchar()) != EOF) X { X pepebuffer[pepeindex++] = c; X if (c == (int)'\n') X { X srandom(1+((line++)*42)); X for (i=0;i'pepedata' <<'END_OF_FILE' X ****** @ @ X ********** \ / X ************** \ / X ***************** #### X ******************** #### X **###################### X ~~~~~~~~~~~~~~~~~~~~~~ END_OF_FILE if test 439 -ne `wc -c <'pepedata'`; then echo shar: \"'pepedata'\" unpacked with wrong size! fi # end of 'pepedata' fi if test -f 'pepesort.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'pepesort.c'\" else echo shar: Extracting \"'pepesort.c'\" \(880 characters\) sed "s/^X//" >'pepesort.c' <<'END_OF_FILE' X#include Xmain(argc,argv) Xint argc; Xchar *argv[]; X{ X int c,pepeindex,swaptemp,i,j,sortpasses; X int pepebuffer[81]; X int line = 0; X if (argc != 2) X { X printf("usage: pepesort sortpasses < pepefile > sortedpepefile\n"); X exit(1); X } X sscanf(argv[1],"%d",&sortpasses); X pepeindex=0; X printf("pepesort after %3d sort passes\n",sortpasses); X while ((c = getchar()) != EOF) X { X pepebuffer[pepeindex++] = c; X if (c == (int)'\n') X { X for (i=0;i pepebuffer[j+1]) X { X swaptemp = pepebuffer[j+1]; X pepebuffer[j+1] = pepebuffer[j]; X pepebuffer[j] = swaptemp; X } X } X } X for (i=0;i'pepeunsort.c' <<'END_OF_FILE' X#include Xmain(argc,argv) Xint argc; Xchar *argv[]; X{ X int c,pepeindex,swaptemp,i,j,sortpasses; X int pepebuffer[81]; X int line = 0; X if (argc != 2) X { X printf("usage: pepeunsort sortpasses < pepefile > sortedpepefile\n"); X exit(1); X } X sscanf(argv[1],"%d",&sortpasses); X pepeindex=0; X printf("pepeunsort after %3d sort passes\n",sortpasses); X while ((c = getchar()) != EOF) X { X pepebuffer[pepeindex++] = c; X if (c == (int)'\n') X { X for (i=0;i'pepezap.c' <<'END_OF_FILE' X#include Xmain(argc,argv) Xint argc; Xchar *argv[]; X{ X int c,pepeindex,swaptemp,swapfrom,swapto,i,nanoseconds; X int pepebuffer[81]; X int line = 0; X if (argc != 2) X { X printf("usage: pepezap nanoseconds < pepefile > zappedpepefile\n"); X exit(1); X } X sscanf(argv[1],"%d",&nanoseconds); X pepeindex=0; X printf("pepezap after %3d nanoseconds\n",nanoseconds); X while ((c = getchar()) != EOF) X { X pepebuffer[pepeindex++] = c; X if (c == (int)'\n') X { X srandom(1+((line++)*42)); X for (i=0;i