... rare tree, rattlin' tree.

Ever heard "Rattlin' bog" before? If not, google for it, a nice example of recursive song ;) And here's a script that will spew out lyrics for it.

Forgive me if these are not 100% correct, I'm not an English native speaker.

#!/usr/bin/perl -w @slowa = ( [ "bog", "in" ], [ "hole", "in" ], [ "tree", "on" ], [ "bough", "on" ], [ "limb", "on" ], [ "branch", "on" ], [ "twig", "on" ], [ "leaf", "on" ], [ "nest", "in" ], [ "bird", "in" ], [ "egg", "in" ], [ "yolk", "in" ], [ "chick", "on" ], [ "wing", "on" ], [ "feather", "on" ], [ "flea", "on" ], [ "eye", "on" ], [ "germ", "on" ], [ "amoeba", "on" ], [ "paramecium", "on" ], [ "virus", "in" ], [ "subatomic particle", "in" ] ); while($foo = $slowa[++$i][0] ) { # refren print "Oh'ro the rattlin bog / ", "and the bog down in the valley o'\n", "Rare bog, rattlin bog / ", "and the bog down in the valley o'\n\n"; push @spiewam, $foo; print " \u$slowa[$i-1][1] that $slowa[$i-1][0] there was a $foo\n", " Rare $foo, rattlin' $foo\n\n"; $j = @spiewam; foreach $bar (reverse @spiewam) { print("\t", ( map {$j == @spiewam ? ucfirst : "And $_"} $bar) , " $slowa[$j-1][1] the ", "$slowa[$j-1][0],\n"); $j--; } print (($i == @slowa-1 ? "\tAnd t" : "\tT"), "he bog down in the valley-o'.\n\n"); }
Hope you enyojed it ;>

Replies are listed 'Best First'.
Re: In that bog there was a tree...
by nimdokk (Vicar) on Jun 03, 2003 at 20:30 UTC
    I think it is correct, I'll have to check it out when I get home and can listen to it as well :-)

    "Ex libris un peut de tout"

Re: In that bog there was a tree...
by kutsu (Priest) on Jun 05, 2003 at 04:31 UTC

    My mom used to call these Oh,no songs. As in any song that last for more then 10 minutes and starts Ohhhh.... :)

    "Pain is weakness leaving the body, I find myself in pain everyday" -me