home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume37 / b1ff / part01 < prev    next >
Encoding:
Text File  |  1993-04-27  |  11.3 KB  |  355 lines

  1. Newsgroups: comp.sources.misc
  2. From: Whitten@Fwva.Saic.Com (David Whitten)
  3. Subject: v37i032:  b1ff - clueless newbie text filter, Part01/01
  4. Message-ID: <1993Apr28.045114.23839@sparky.imd.sterling.com>
  5. X-Md4-Signature: c8b08535936b4e3c63020b310e601a49
  6. Date: Wed, 28 Apr 1993 04:51:14 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Whitten@Fwva.Saic.Com (David Whitten)
  10. Posting-number: Volume 37, Issue 32
  11. Archive-name: b1ff/part01
  12. Environment: UNIX
  13.  
  14. Here's the latest version of B1FF!!!
  15. written by Matt, and modified by me (David Whitten)
  16. I'm losing net access, so maybe someone will enjoy this...
  17.  
  18. Dave Whitten
  19. #---------------cut here------------------
  20. #! /bin/sh
  21. # This is a shell archive.  Remove anything before this line, then feed it
  22. # into a shell via "sh file" or similar.  To overwrite existing files,
  23. # type "sh file -c".
  24. # Contents:  README Makefile b1ff.l
  25. # Wrapped by kent@sparky on Tue Apr 27 23:47:05 1993
  26. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin ; export PATH
  27. echo If this archive is complete, you will see the following message:
  28. echo '          "shar: End of archive 1 (of 1)."'
  29. if test -f 'README' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'README'\"
  31. else
  32.   echo shar: Extracting \"'README'\" \(349 characters\)
  33.   sed "s/^X//" >'README' <<'END_OF_FILE'
  34. XThis programs should work on any flavour of UNIX which has 'lex'.
  35. Xb1ff:
  36. Xwill turn English into B1FFSTER speech, guaranteed to confuse and entertain.
  37. XTo create it in the current directory, type 
  38. Xmake b1ff
  39. XUse
  40. X  cat [file_of_text] | b1ff | more
  41. Xor
  42. X  man [command] | b1ff | more
  43. Xfor endless hours of fun.
  44. XMake copies if you want etc.etc.
  45. END_OF_FILE
  46.   if test 349 -ne `wc -c <'README'`; then
  47.     echo shar: \"'README'\" unpacked with wrong size!
  48.   fi
  49.   # end of 'README'
  50. fi
  51. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  52.   echo shar: Will not clobber existing file \"'Makefile'\"
  53. else
  54.   echo shar: Extracting \"'Makefile'\" \(219 characters\)
  55.   sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  56. X#Makefile for b1ff
  57. X#Put in your favourite lex or C compiler here
  58. XLEX = lex
  59. XCC = cc
  60. XCLIBS = -ll
  61. XCFLAGS = -O -s
  62. XRM = /bin/rm
  63. Xb1ff:    b1ff.l
  64. X    $(LEX) b1ff.l
  65. X    $(CC) $(CFLAGS) -o b1ff lex.yy.c $(CLIBS)
  66. X    $(RM) -f lex.yy.c
  67. END_OF_FILE
  68.   if test 219 -ne `wc -c <'Makefile'`; then
  69.     echo shar: \"'Makefile'\" unpacked with wrong size!
  70.   fi
  71.   # end of 'Makefile'
  72. fi
  73. if test -f 'b1ff.l' -a "${1}" != "-c" ; then 
  74.   echo shar: Will not clobber existing file \"'b1ff.l'\"
  75. else
  76.   echo shar: Extracting \"'b1ff.l'\" \(8168 characters\)
  77.   sed "s/^X//" >'b1ff.l' <<'END_OF_FILE'
  78. X%{
  79. X/*
  80. XFor the information of some:
  81. XB1FF is a fictitious person who is "new" on the 'net.
  82. XYou can recognize his posts by:
  83. X  He always SHOUTS as he types.
  84. X  He sometimes spells FONET1KLEE (phonetically) the rest of the time, he  
  85. X    just misspells words or punctuates them incorrectly.
  86. X  He shortens some words (presumably for ease in typing)
  87. X   like '4' for 'for' or 'four'
  88. X   like '2' for 'two' or 'to' or 'too'
  89. X   like '&' for 'and'
  90. X   like 'U' for 'you' or 'ewe'
  91. X   like 'R' for 'are'
  92. X   like 'C' for 'sea' or 'see'
  93. X  
  94. XHe can't see the difference between certain letters
  95. X       like '1' and 'i'
  96. X    or like '0' and 'o'
  97. X    or like '5' and 's'
  98. X    or like '2' and 'z'
  99. X  His speech is peppered with profanity.
  100. X  He never uses only one '!' or '?' when '!!!!!!!!' or '????!!!!' will do.
  101. X  He never uses the apostrophe (') and always uses the double quote (")
  102. X     instead.
  103. X  I have some vague memory of B1FF being mentioned in the New Hackers
  104. Xdictionary, but I can't verify the validity of this.
  105. X  I can't even validate that his full name is NELSON 0TB1FF , but it sounds
  106. Xcorrect.
  107. X*/
  108. X/*
  109. XHere's the promised and long-awaited 'b1ff.x' English->B1FF converter
  110. Xthat everyone's been clamoring for. I made a few small changes since the
  111. Xlast version and made sure that it compiled correctly.
  112. XTo compile this, save it to the file 'b1ff.x' and execute the following
  113. Xtwo commands:
  114. X    lex b1ff.x
  115. X    cc -o B1ff lex.yy.c -ll
  116. XNote that the flags on cc should be in that order. You'll end up with the
  117. Xexecutable 'B1ff' (if you call it 'biff' with a lowercase 'b' you'll
  118. Xconflict with the biff mail-checking program). 
  119. XSend me any bugs or patches; I'm good friends with B1FF and since this is 
  120. Xthe first program he's ever posted to the net, he wants to know if you
  121. Xhave any problems. 
  122. Xmdw
  123. X*/
  124. X /* 
  125. X  * B1FF.X by Matt Welsh (mdw@tc.cornell.edu) +1 607 253 2737
  126. X  *  modified and improved by David Whitten 
  127. X  *
  128. X  * $Id: b1ff.x,v 1.1 92/11/03 18:31:10 mdw Exp Locker: mdw $
  129. X  * $What: <@(#) b1ff.x,v    1.13> $
  130. X  *
  131. X  * Simulates our favorite guy, the B1FFSTER!!!!1!!!
  132. X  *
  133. X  * To compile, do the following:
  134. X  *
  135. X  *   lex b1ff.x
  136. X  *   cc -o B1ff lex.yy.c -ll
  137. X  *
  138. X  * Yes, this is very poorly written, and yes, it was a late-night hack.
  139. X  * But it seems to work, mail me if it doesn't compile, or if you find 
  140. X  * any bugs or make any additions.
  141. X  * Happy B1FFing,
  142. X  * 
  143. X  * mdw
  144. X  * 
  145. X  */
  146. X    char buf[128];
  147. X%}
  148. XBW [     ]
  149. XEW [     .,;!?]
  150. XWC        [A-Za-z']
  151. XNW        [^A-Za-z']
  152. X%start        INW NIW 
  153. X%e 3000
  154. X%p 6000
  155. X%n 1000
  156. X%k 500
  157. X%a 4000
  158. X%o 15000
  159. X%%
  160. X\\[^ \n]+    ECHO;
  161. X{NW}        { BEGIN NIW; ECHO; }
  162. X"..."           { BEGIN NIW;
  163. X            printf((rand()%2) ? "...C00L HUH!?! " : "...!! "); }
  164. X"."/{NW}    { BEGIN NIW; printf((rand()%2) ? "." : "!!" ); }
  165. X".\""           { BEGIN NIW; printf((rand()%2) ? "!!!\"" : "!1!!\"" ); }
  166. X"!"$            { BEGIN NIW; printf("!!!!!!!!!!1"); }
  167. X"!"+/{NW}       { BEGIN NIW; printf("!1!"); }
  168. X"?"/{NW}        { BEGIN NIW; printf("??!!"); }
  169. X"?"             { BEGIN NIW; printf("?!");  }
  170. X":)"            { BEGIN NIW; printf(";-)!!! "); }
  171. X"8)"            { BEGIN NIW; printf(";-)!!! "); }
  172. X":*)"           { BEGIN NIW; printf(";-)!!!!  "); }
  173. X":-)"           { BEGIN NIW; printf(";-)!!!!  "); }
  174. X"'"             { BEGIN NIW; printf("\""); }
  175. X"ove"           { BEGIN INW; printf("UV "); }
  176. X"move"        { BEGIN INW; printf("MOOV"); }
  177. X"ea"            { BEGIN INW; printf("EE"); }
  178. X"ies"           { BEGIN INW; printf("YS"); }
  179. X"please"        { BEGIN INW; printf("PLEEZ!"); }
  180. X"Please"        { BEGIN INW; printf("PLEEZ"); }
  181. X"Thanks"        { BEGIN INW; printf("THANX!!"); }
  182. X"thanks"        { BEGIN INW; printf("THANX"); }
  183. X"enough"        { BEGIN INW; printf("ENUF"); }
  184. X"Enough"        { BEGIN INW; printf("ENUFF"); }
  185. X"does"          { BEGIN INW; printf("DUZ"); }
  186. X"Does"          { BEGIN INW; printf("DUZ"); }
  187. X"fuck"/{NW}     { BEGIN INW; printf("FUCK !!!!!1 "); }
  188. X"Fuck"/{NW}     { BEGIN INW; printf("FUCK !!!!!1 "); }
  189. X"damn"          { BEGIN INW; printf("FUCK!! "); }
  190. X<NIW>"hell"/{NW}          { BEGIN INW; printf("FUCK!! "); }
  191. X"Damn"          { BEGIN INW; printf("FUCK!! "); }
  192. X"Shit"          { BEGIN INW; printf("FUCK!! "); }
  193. X"shit"          { BEGIN INW; printf("FUCK!! "); }
  194. X<NIW>"Hell"/{NW}          { BEGIN INW; printf("FUCK!! "); }
  195. X<NIW>"dick"/{NW}          { BEGIN INW; printf("FUCK!! "); }
  196. X<NIW>"Dick"/{NW}          { BEGIN INW; printf("FUCK!! "); }
  197. X<NIW>"mad"/{NW} { BEGIN INW; printf("PISSED 0FF!!!1! "); }
  198. X<NIW>"Mad"/{NW} { BEGIN INW; printf("PISSED 0FF!!!1! "); }
  199. X"ar"/{NW}       { BEGIN NIW; printf("RE"); }
  200. X"are"/{NW}      { BEGIN INW; printf("R"); }
  201. X"ain"/{NW}      { BEGIN NIW; printf("ANE"); }
  202. X"before"/{NW}    { BEGIN NIW; printf("B4");}
  203. X"for"/{NW}    |
  204. X"fore"/{NW}    { BEGIN NIW; printf("4");}
  205. X"four"/{NW}    { BEGIN NIW; printf("FORE ");}
  206. X"sea"/{NW}    |
  207. X"see"/{NW}    { BEGIN NIW; printf("C ");}
  208. X"to"/{NW}       |
  209. X"too"/{NW}      { BEGIN NIW; printf("2"); }
  210. X"two"/{NW}      { BEGIN NIW; printf("TO "); }
  211. X"one"/{NW}      { BEGIN NIW; printf("1"); }
  212. X<INW>"ould"/{NW} {BEGIN NIW; printf("UD ");}
  213. X"ic"/{NW}       { BEGIN NIW; printf("IK"); }
  214. X"le"/{NW}       { BEGIN NIW; printf("EL"); }
  215. X"by"/{NW}       { BEGIN NIW; printf("BUY"); }
  216. X"buy"/{NW}      { BEGIN NIW; printf("BY"); }
  217. X"bye"/{NW}      { BEGIN NIW; printf("BY"); }
  218. X"e"/{NW}        { BEGIN NIW;
  219. X             printf((rand()%2) ? "E" : (rand()%2 ? "E" : "3");}
  220. X"ewe"        |
  221. X"you"           { BEGIN INW; printf("U"); }
  222. X"your"          { BEGIN INW; printf("YOU'RE"); }
  223. X"there"         { BEGIN INW; printf("THARE"); }
  224. X"they're"       { BEGIN INW; printf("THARE"); }
  225. X"cause"         { BEGIN INW; printf("CUZ"); }
  226. X<INW>"or"       { BEGIN INW; printf((rand()%2) ? "OR" : "ER"); }
  227. X"and"           { BEGIN INW; printf("&"); }
  228. X"biff"          { BEGIN INW; printf("B1FFSTER!!!!!"); }
  229. X"BIFF"          { BEGIN INW; printf("B1FFSTERE!!!1!"); }
  230. X"Biff"          { BEGIN INW; printf("B1FFSTERE!!!1!"); }
  231. X"tion"          { BEGIN INW; printf("SHUN"); }
  232. X"good"        |
  233. X"cool"          { BEGIN INW; printf("C00L!!!"); }
  234. X"computer"      { BEGIN INW; printf("C-64"); }
  235. X"software"      { BEGIN INW; printf("WAREZ!1!!"); }
  236. X"program"       { BEGIN INW; printf("WAREZ!1!!"); }
  237. X"gal"        |
  238. X"girl"        |
  239. X"woman"        { BEGIN INW; printf("BAB3"); }
  240. X"boy"        |
  241. X"dude"        |
  242. X"Mr"            |
  243. X"man"/{NW}      |
  244. X"Man"         { BEGIN INW; printf("D00D"); }
  245. X"some"          { BEGIN INW; printf("SUM"); }
  246. X"a"             { BEGIN INW; printf("A"); }
  247. X"b"             { BEGIN INW; printf("B"); }
  248. X"c"             { BEGIN INW; printf("C"); }
  249. X"d"             { BEGIN INW; printf("D"); }
  250. X"e"             { BEGIN INW; printf("E"); }
  251. X"f"             { BEGIN INW; printf("F"); }
  252. X"g"             { BEGIN INW; printf("G"); }
  253. X"h"             { BEGIN INW; printf("H"); }
  254. X"i"             { BEGIN INW; printf((rand()%2) ? "I" : "1"); }
  255. X"I"             { BEGIN INW; printf((rand()%2) ? "I" : "1"); }
  256. X"j"             { BEGIN INW; printf("J"); }
  257. X"k"             { BEGIN INW; printf("K"); }
  258. X"l"             { BEGIN INW; printf("L"); }
  259. X"ll"            { BEGIN INW;
  260. X             printf((rand()%2) ? "LL" : (rand()%2 ? "L" : "LLL");}
  261. X"m"             { BEGIN INW; printf("M"); }
  262. X"n"             { BEGIN INW; printf("N"); }
  263. X"nn"            { BEGIN INW;
  264. X             printf((rand()%2) ? "NN" : (rand()%2 ? "N" : "NNN");}
  265. X"o"             { BEGIN INW; printf("0"); }
  266. X"oo"            { BEGIN INW; 
  267. X              printf((rand()%2) ? "00" : "UU"); }
  268. X"O"         { BEGIN INW; printf("0"); }
  269. X"OO"            { BEGIN INW; 
  270. X              printf((rand()%2) ? "00" : "UU"); }
  271. X"ph"            { BEGIN INW; printf("F"); }
  272. X"Ph"            { BEGIN INW; printf("F"); }
  273. X"p"             { BEGIN INW; printf("P"); }
  274. X"q"             { BEGIN INW; printf("Q"); }
  275. X"r"             { BEGIN INW; printf("R"); }
  276. X"s"             { BEGIN INW; printf((rand()%2) ? "5" : "S"); }
  277. X"S"             { BEGIN INW; printf((rand()%2) ? "5" : "S"); }
  278. X"t"             { BEGIN INW; printf("T"); }
  279. X"u"             { BEGIN INW; printf("U"); }
  280. X"v"             { BEGIN INW; printf("V"); }
  281. X"w"             { BEGIN INW; printf("W"); }
  282. X"x"             { BEGIN INW; printf("X"); }
  283. X"y"             { BEGIN INW; printf("Y"); }
  284. X"z"             { BEGIN INW; printf((rand()%2) ? "2" : "Z"); }
  285. X.        printf(yytext);
  286. X\n        printf("\n");
  287. X.        { BEGIN INW; ECHO; }
  288. X%%
  289. Xmain()
  290. X{
  291. X    srand(getpid());
  292. X    yylex();
  293. X    return(0);
  294. X}
  295. END_OF_FILE
  296.   if test 8168 -ne `wc -c <'b1ff.l'`; then
  297.     echo shar: \"'b1ff.l'\" unpacked with wrong size!
  298.   fi
  299.   # end of 'b1ff.l'
  300. fi
  301. echo shar: End of archive 1 \(of 1\).
  302. cp /dev/null ark1isdone
  303. MISSING=""
  304. for I in 1 ; do
  305.     if test ! -f ark${I}isdone ; then
  306.     MISSING="${MISSING} ${I}"
  307.     fi
  308. done
  309. if test "${MISSING}" = "" ; then
  310.     echo You have the archive.
  311.     rm -f ark[1-9]isdone
  312. else
  313.     echo You still must unpack the following archives:
  314.     echo "        " ${MISSING}
  315. fi
  316. exit 0
  317. exit 0 # Just in case...
  318.