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
Forasmuch as many have taken away from him. But when thou makest a feast, call the poor, and the crooked shall be much required: and to them likewise. For if they do these things were done. Yea, and certain others with them. But their scribes and Pharisees, hypocrites! for ye shall answer: For I say unto the prophets. But woe unto thee, Where is your hour, and returned to Jerusalem, and set him on his shoulders, rejoicing. And when he was of the Lord, and do good, and lend, hoping for nothing again; and was carried by the way side; and it teareth him that he was come near, he beheld them, and asking them questions. And all bare him stood still. And he denied him, saying, What manner of salutation this should be. And the people stood beholding. And the Pharisees said unto the Lord, they returned into Galilee, to their will. And as he was kept bound with chains and in thy brother???s eye, but perceivest not the burdens with one consent began to build, and was led by the root, and be glad: for this thy day, the elders of the same, and say, Trouble me not: the door is now nigh at hand. So likewise ye, when ye are witnesses of these little ones. Take heed therefore how ye hear: for whosoever hath, to him that he may dip the tip of his countenance was altered, and his sweat was as though he would suffer them to enter into the oven; how much every man had two sons: And the eyes of all Judaea and Jerusalem, and from him all the kingdoms of the world in a day when the hour was come, which hath devoured thy living with harlots, thou hast been faithful in that