home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / sillies / silly10 / !Yow / !Help < prev    next >
Text File  |  1994-01-11  |  6KB  |  129 lines

  1. !Yow 1.07 16-Jun-1993
  2.  
  3. !Yow displays a random "fortune cooky", quotation or witicism in a
  4. window.  The window closes when you click SELECT or MENU in it or re-run
  5. !Yow.  Clicking ADJUST displays a new fortune.  If the desktop is not
  6. running !Yow just prints a text to the current output stream(s).
  7.  
  8. This program is Copyright © 1992 Denis Howe and may be distributed freely
  9. provided nothing is charged for it and this copyright notice is retained.
  10. Comments, suggestions for improvements and new texts are welcome.
  11.  
  12. Denis Howe <dbh@doc.ic.ac.uk>    After all, all he did was string together
  13. 48 Anson Rd, London NW2 3UU      a lot of old, well-known quotations.
  14. +44 (81) 450 9448                        - H. L. Mencken, on Shakespeare
  15.  
  16. History
  17. -------
  18. See !RunImage for details of modifications.
  19.  
  20. The name !Yow was used by Ian Rawlings <ssurawls@uk.ac.rdg.susssys1> for
  21. his program which inspired this one (see below) but I have pretty much
  22. completely rewritten it as well as greatly extending the data file
  23. (YowLines).  I got the Garfield icons and some of the quotes from a program
  24. called !Quotation by Roger Spooner.  Other texts come from Walther
  25. Schoonenberg <walther@econ.vu.nl>'s program !Cooky, David K. Barber (aka
  26. Nigelstache) <Barber_DK@P1.lancsp.ac.uk>'s program Cookie, several versions
  27. of the Unix fortunes.dat file, a more recent file full of jokes mailled to
  28. me by Ian, various people's e-mail signatures and the Terry Pratchett quotes
  29. file from the alt.fan.pratchett newsgroup the Red Dwarf quotes file from
  30. alt.tv.red-dwarf via toaster.ee.ubc.ca /pub/red-dwarf/fortune-quotes.
  31.  
  32. Algorithm
  33. ---------
  34. The program originally loaded the whole file into memory, picked a random
  35. text by its number within the file and then searched through memory for the
  36. Nth text.  No wonder Ian thought he wanted a better compiler, what he
  37. actually wanted was a better algorithm!
  38.  
  39. The program now uses an index file which contains the 32-bit byte offset of
  40. the start of each text in YowLines.  The number of texts is thus the length
  41. of the index file divided by four.  This is used to select a random index
  42. and this index is then used to go straight to the right place in YowLines.
  43. A window is created in the middle of the screen and the text is printed in
  44. it, breaking lines at spaces if necessary.
  45.  
  46. The index file is created by the Basic program "MkIndex".  This must be
  47. re-run if YowLines is modified.  This loads the whole of YowLines (currently
  48. ~550 kbytes) into RAM and needs a Next slot of 608 k to run.  It could
  49. easily be rewritten to read YowLines and write Index sequentially and run
  50. slightly slower in almost no RAM.
  51.  
  52. Sort & Gen programs
  53. -------------------
  54. Two other programs are included in the !Yow application directory.
  55.  
  56. "Sort" sorts the data file to make it easier to spot duplicates when
  57. merging a new file of texts.
  58.  
  59. The second program, "Gen" is based on an idea from Scientific American which
  60. the Hacker Jargon File calls disassociated text.  It generates random
  61. sequences of characters based on the frequency of occurence of strings of n
  62. characters in some example text (YowLines in this case).  The parameter "n"
  63. (Mem%) determines how many previous output characters the program remembers
  64. in order to choose the next one.  If n=4 say, it searches YowLines randomly
  65. for an occurence of the last three characters output, looks at the character
  66. following them in the file, outputs it and shifts it onto it's memory FIFO
  67. (first-in first-out) buffer.  The effective value of "n" counts up from 1
  68. (an initial \0 output is assumed) on start-up.  This process is equivalent
  69. to using frequency tables for all sequences of "n" characters.  That
  70. would run much faster but would take a long time to calculate the
  71. tables.
  72.  
  73. Ian's original documentation
  74. ----------------------------
  75. Snail Mail Address:
  76.       Ian Rawlings
  77.       St. Lawrence,
  78.       Salisbury Road,
  79.       West Wellow,
  80.       Near Romsey,
  81.       HANTS S051 6AP
  82.       Tel (0794) 22086
  83.  
  84. EMAIL address: ssurawls@uk.ac.rdg.susssys1
  85.  
  86. This is an Archified version of YOW on the IBM.  It is one of those
  87. hateful Fortune cookie programs that simply plonk a phrase at random
  88. onto the screen, the file of phrases in this case being taken from the
  89. IBM side thru' PCdir.  I don't know exactly who wrote the thing (apart
  90. from the fact that they obviously don't lead a very interesting life if
  91. they are prepared to sit down and write all that bumf) but the file from
  92. the IBM had a header that I have stripped for simplicity of programming,
  93. 'cos I'm not too good yet!  The header is included below for those
  94. interested.
  95.  
  96. It's American, so many of the phrases are not funny to us, and some of
  97. the phrases are obviously hilarious to the author but are totally lost
  98. on me.  Still, it does throw up some gems occasionally, eg "A Liberal
  99. is somebody too poor to be a Capitalist and too rich to be a Communist"
  100.  
  101. Due to the gumf that goes on, not even Archie basic V could get a good
  102. enough response time, so out of desperation I compiled it at a friends
  103. house using RISC basic from Silicon Vision.  After the heavy editing
  104. necessary to get the program to compile I ended up with a 22K file from
  105. an original of 2.6K, it needed 64K instead of 40K to run, and it also
  106. needs the Floating Point Emulator loaded!  It did run faster though,
  107. which has never happened before when using RISC basic.  Usually the
  108. program runs slower!  Could somebody PLEASE bring out a decent BASIC
  109. compiler?! 
  110.  
  111. My Bank Manager forced me to return my Memory Expansion to Diamond
  112. Computing.  I'd only had it for a week, but it really is missed!
  113.  
  114. The original header
  115. -------------------
  116. Zippy the pinhead data base.  The official copy of this is in the file
  117.  "MLY;YOW >" on MC.MIT.EDU
  118. Everything up to the first ascii \000 (`null') character is a comment.
  119. The file consits of zippy quotations (from various comic books and
  120.  strips by Bill Griffith) followed by a null character.
  121.  Newline chracters following a quotation are ignored and are present
  122.  only for readability.
  123. Have FUN!
  124. This file is currently used by:
  125.  * the FORTUNE program on MIT-OZ
  126.  * the m-x yow command in GNU Emacs.
  127.  * NIL (MIT Common Lisp)'s debugger
  128.  * something bandy wrote at LLL-CRG.
  129.