Saturday, January 14

elk|rabbits|deer|mice

through the bright moonlight the mice dream
on my lawn

the celebrants of some ancient rite

a simple engine for expressing poetic variation

The short poem above is actually the output of a routine to express variation within a block of text. Given a block of text where sets of alternative words (or strings in general) are marked off within curly brackets and separated by pipes, it randomly selects among the alternatives. Thus:

the {green|red} light
spoke to {him|her|them}
of a {tragic|distant|idyllic} {past|future}

Might become:

the red light
spoke to her
of a tragic past

Even without nested alternatives, conditionals, or any kind of branching, this is surprisingly flexible. You can take a look at the source, if you like, or reload this entry to get a new variation.