This was originally a project for a data structures and algorithms course.
Input a reasonably long chunk of text and press Babble to get your result. The aim of this simple program is to produce an output that makes semi-grammatical sense at first glance, but doesn't make much logical sense when you actually try reading it. More text is always better; use at least a paragraph for best results. Song lyrics can often produce amusing results.
The "Babbliness" factor determines how closely the output will match the input. Output with a Babbliness value of 5 will not resemble the input very much at all and will probably not make much grammatical sense, while output with a Babbliness value of 1 will make good grammatical sense but possibly be nearly identical to the input text.
Sample inputs: Green Eggs and Ham Goldilocks and the Three Bears Still Alive Declaration of Independence Gospel of Luke Romeo and Juliet
Once upon a time, there was a little girl named Goldilocks. She went for a walk in the kitchen, there were three bowls of porridge. "Ahhh, this porridge is too big, too!" she whined. So she sat in the kitchen, there were three bowls of porridge. "Ahhh, this chair is just right," she sighed. But just as she settled down into the living room where she saw three chairs. Goldilocks sat in the first chair to rest her feet. "This chair is too cold," she said So, she tasted the last bowl of porridge. "Ahhh, this porridge is just right," she said So, she walked into the chair to rest, it broke into pieces! Goldilocks was hungry. She tasted the last and smallest chair. "Ahhh, this chair is too hot!" she exclaimed. So she tried the last and smallest chair. "Ahhh, this porridge is just right," she said happily and she ate it all up. After she'd eaten the three bears. She screamed, "Help!" And she jumped up and saw the three bears. She screamed, "Help!" And she jumped up and ran away into the living room where she saw three chairs. Goldilocks sat in the first bed, but it was too hard. Then she lay in the kitchen, there were three bowls of porridge. Goldilocks was hungry. She tasted the porridge from the first bed, but it was just right. Goldilocks fell asleep. As she was feeling a little girl named Goldilocks. She went for a walk in the second bed, but it was too soft. Then she lay in the first bowl. "This porridge is too hot!" she exclaimed. So she sat in the second chair. "This chair is too hot!" she exclaimed. So, she tasted the last bowl of porridge. "Ahhh, this chair is too big!" she