Friday, September 19, 2008

Recursion

A child couldn't sleep, so her mother told her a story about a little frog,
who couldn't sleep, so the frog's mother told her a story about a little bear,
who couldn't sleep, so the bear's mother told her a story about a little weasel...
who fell asleep.
...and the little bear fell asleep;
...and the little frog fell asleep;
...and the child fell asleep.

(Via squonk + wharfinger)

1 comment:

Anonymous said...

This is not a tail recursion. :-(

Change the animals to Squirrel, Mouse and Dog.