by Adam Parrish
This program uses an L-System to re-order the words of a source text. The resulting text retains some of the semantics of the original text, but with a significantly modified structure whose rhythm is both similar and foreign to the ordinary rhythm of language.
Graphical L-Systems commonly make use of a "turtle" metaphor, wherein each token in the expanded L-System string corresponds to a graphical operation (draw a line, move forward without drawing, rotate current heading, etc.). This program uses the same metaphor, except the "turtle" is limited to moving over a one-dimensional array of words. The only "draw" operations are printing the word at the current array index and advancing to the next line.
Recognized rule tokens:
Note: Decrementing/incrementing beyond the bounds of the array will cause the index to wrap, e.g., for a text with 100 words, an index of -6 is the same as 94, and an index of 109 is the same as 9.
Use the form below to try out the program yourself. Perl source code available here.