The goths in Microsoft eats harshly on the plain. (Proverb) Fidel Castro wrote in to tell us that Microsoft trampled to construct diamonds for IBM. (Slashdot) The rain in Microsoft desires quickly on the Macintosh. (Proverb) Fidel Castro and one bicycle twisted to release goths; unfortunately Trekkies trampled plain. (Movie Plot) A small clone of Bill Gates and a small clone of Bill Gates twisted to baste Pentium chip; unfortunately diamonds ignited town hall. (Movie Plot) The town hall in the Black Hole of India supports lazily on the rain. (Proverb) Fidel Castro wrote in to tell us that Microsoft tempted to release diamonds for AT+T. (Slashdot) The your mother in the North Pole destroys evily on the peanut butter. (Proverb) Ernest Borgnine wrote in to tell us that Time-Warner rained to release a horde of Fidel Castro clones for Microsoft. (Slashdot) A misplaced mouse and an elephant begged to destroy your mother; unfortunately action figures begged Pentium chip. (Movie Plot) -- source code follows -- #!/usr/bin/perl # Cmdr Taco seems to like the [insert thing here] Random Generators, # and they look all the same to me. # This program is an explanation why. # Inspired by a Solaris program called /usr/games/thought use strict; my @phrases = ('The %noun in %place %verb_n %adverb on the %noun. (Proverb)' ,'%name wrote in to tell us that %company %verb_p %verb_i %nouns for ' .'%company. (Slashdot)' ,'%noun1 and %noun1 %verb_p %verb_i %noun; unfortunately %nouns %verb_p ' .'%noun. (Movie Plot)' ); # The phrases need to be numerous, and many of them may vary only slightly # from each other. The %terms describe what word/phrase belongs there. If # you're thinking of the old game of "Baseball MadLibs," you've hit # paradigmal paydirt. my %dictionary; $dictionary{'noun'} = [ "rain","plain","Ernest Borgnine","your mother","goths","Macintosh" ,"Pentium chip","town hall","peanut butter"]; $dictionary{'noun1'} = [ "an elephant","Fidel Castro","one bicycle","a misplaced mouse" ,"a small clone of Bill Gates","a bottle of chocolate syrup"]; # singular nouns $dictionary{'nouns'} = [ "elephants","a horde of Fidel Castro clones","action figures","shoes" ,"Linux advocates","Trekkies","diamonds","sixty pounds of hamburger"]; # plural nouns $dictionary{'place'} = [ "Spain","Microsoft","the North Pole","the Black Hole of India" ,"Area 51","Toronto","your left nostril","Leonardo DiCaprio's underwear" ]; $dictionary{'name'} = [ "Fidel Castro","Ernest Borgnine","Elvis","Cmdr Taco","Moses Moore", ,"Ed the Wonder Squirrel","the Devil","Harrison Ford","David Bowie" ]; $dictionary{'company'} = [ "Microsoft","Netscape","Time-Warner","SlashDot.Org","IBM","AT+T" ,"the Free Software Foundation","Vlad's Auto Repair","Wal-Mart" ]; $dictionary{'adverb'} = [ "mainly","quickly","darkly","evily","sexually","offensively","harshly", ,"gently","squooshily","lazily","desperately","easily"]; $dictionary{'verb_p'} = [ "rained","trampled","incinerated","irrigated","tempted","begged","twisted", ,"irriadiated","whipped","solicited","raced","impaled","ignited" ]; # verb in past tense. $dictionary{'verb_n'} = [ "rains","sells","destroys","makes love","eats","corrupts","supports" ,"desires","flattens" ]; # verb in present (or "now") tense $dictionary{'verb_i'} = [ "to destroy","to release","to baste","to construct"]; # verb in infinitive form $dictionary{'verb_ni'} = [ "plan","hope","pray","exist"]; # present infinitive form? # Argh, going to need to hit an English grammar website $dictionary{'verb_f'} = [ "will announce","is going to present","will acquire" ,"intends to assimilate" ]; # verb in future tense # The real key to making good phrases is being very specific in the types of # phrases that can be substituted. The way I came up with the phrases was to # think of some random sentences, or read them from a newspaper, and remove # any words that have meaning and replace them with description of the word's # substance. Hit a grammar website to read up on the parts of the English # language, and then make some special cases (like "plural nouns" and "singular # nouns"). my $how_many_you_want = (shift or $ENV{'QUERY_STRING'} or 10); # remember "shift" works on @ARGV by default. print "Content-Type: text/plain\n\n" if ($ENV{'SCRIPT_NAME'}); # run as CGI srand(); while($how_many_you_want--) { my $phrase = $phrases[int(rand($#phrases+1))]; $phrase =~ s/(^|\s)\%(\w+) /"$1".$dictionary{$2}->[int(rand($#{$dictionary{$2}}+1))] /egx; print ucfirst($phrase)."\n"; } if ($ENV{'SCRIPT_NAME'}) { # This is so web people can see the source code when viewing it on the web. print "\n-- source code follows --\n"; open (FILE,$0) or die "Whoa, I can't find myself!\n$0:$!\n"; while () { print; } close (FILE) }