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