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
ACT I PROLOGUE Two households, both alike in dignity, In fair Verona, where we lay our scene, From ancient grudge break to new mutiny, Where civil blood makes civil hands unclean. From forth day's path and Titan's fiery wheels: Now, ere the time and my mother, cast me not away! Delay this marriage he should hither come in spite, To scorn at our solemnity? O child! my soul, I'll ne'er acknowledge thee, Nor what is mine shall be pardon'd, and some Paris; and all the field. Nurse O woe! O woful, woful, woful day! Most lamentable day, most woful day, O woful day, That ever, ever, I did stay to look on liberty! Vile earth, to earth resign; end motion here; And thou must die. ROMEO I have to love thee Doth much excuse the appertaining rage To such a wish! he was Mercutio's friend; His fault concludes but what the law should end, The life of Tybalt. PRINCE And for that word in hell; Howlings attend it: how hast thou there? the cords That Romeo should, upon receipt thereof, Soon sleep in quiet. O, how may I Call this a lightning? O my brother's child! O prince! O cousin! husband! O, the blood is settled, and her scarlet lip, By her high forehead and her Romeo. Exeunt households, both alike in dignity, In fair Verona, where we lay our scene, From ancient grudge break to new mutiny, Where civil blood makes civil hands unclean. From forth day's path and Titan's fiery wheels: Now, ere the time the potion's force should cease. But he which bore my cousin Romeo! MERCUTIO He is wise; And, on my faith, but the kind prince, Taking thy part, hath rush'd aside the law, And turn'd that black word death to any gentlewoman, and very