home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
txtutl
/
travesty.arc
/
README.TRV
next >
Wrap
Text File
|
1988-11-17
|
2KB
|
48 lines
TRAV
This archive contains the Turbo C 2.0 source and the executable for
TRAV, an implementation of the travesty algorithm which originated
with the ancient Arab scholars and was responsible for many of the
world's more interesting pieces of literature. TRAV is a productivity
tool useful for enhancing any form of text, embellishing and extending
it into a form guaranteed to have a greater impact. Actually, I think a
friend first read about it in a computer magazine (BYTE?).
What does it do? Read on, or examine the file ROCKY.
USAGE : TRAV <order> where <order> is an integer from 2-16.
TRAV reads the standard input (max filesize = 32Kbytes) and then starts
its magic. It statistically reorganizes the input into an infinite
and entertaining (at least for a while) form.
A travesty has an "order" associated with it. The order is a positive integer
which roughly describes the violence of the transformation. The lower the
order, the more disturbing the output will be to read. You pass the order
to TRAV on the command line.
The algorithm works like this:
The first <order> characters of the input are immediately output. Then,
an infinite loop starts, each loop generating a single character of output.
For each of these loops, the program examines the last <order> characters
of the output. It then scans the entire input file for occurences of this
string. Each time it finds one, it looks to see what character follows it.
Each of these characters is thrown into a set. After all the eligible
succeeding characters are collected in this fashion, one is selected from
the set at random. The infinite loops repeats.
TRAV tries to format its own lines, inserting newlines into the output
whenever it seems right. Line format of the input file is ignored
(newlines are converted into spaces).
If TRAV ever gets to a point where there are NO eligible successors, it hops
back to the very top of the input table and restarts the whole spiel.
enjoy!
Anthony M. Lovell
270 Highland Avenue #23
Somerville, MA 02143. (617) 623-5870
email: amlovell@phoenix.princeton.edu