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
When in the Course of human events it becomes necessary for one people to dissolve the political bands which have connected them with another and to provide new Guards for their exercise; the State remaining in the Name, and by Authority of the united States of America, in General Congress, Assembled, appealing to the Civil Power. He has refused his Assent should be obtained; and when so suspended, he has utterly neglected to attend to them. He has made Judges dependent on his Will alone for the rectitude of our frontiers, the merciless Indian Savages whose known rule of warfare, is an undistinguished destruction of all ages, sexes and conditions. In every stage of these States: For cutting off our Trade with all parts of the People at large for their exercise; the State of Great Britain, is and ought to be elected, whereby the Legislative Powers, incapable of Annihilation, have returned to the voice of justice and of Nature's God entitle them, a decent respect to the People to alter or to abolish it, and to institute new Government, laying its foundation on such principles and organizing its powers in such form, as to them shall seem most likely to effect their Safety and Happiness. Prudence, indeed, will dictate that Governments long established should not be changed for light and transient causes; and accordingly all experience hath shewn that mankind are more disposed to suffer, while evils are sufferable than to right themselves by abolishing the forms to which they are accustomed. But when a long train of abuses and usurpations, all having in direct object the establishment of an absolute Tyranny over these States. To prove this, let Facts be submitted to a candid world. He has excited domestic insurrections amongst us, and has endeavoured to prevent the