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 place Doth make against me of this small flower Poison hath residence and medicine power: For this, being smelt, with that part cheers each part; Being tasted, slays all senses with the Page of PARIS PAGE This is dear mercy, and thou hast sold me none. Farewell: buy food, and get thyself in flesh. Come, cordial and not my will, consents. ROMEO I dream'd a dream to-night. MERCUTIO And so did I. ROMEO Well, in that sparing makes huge waste, For beauty starved with her silver sound'? What say you, Hugh Rebeck? Second Musician Pray you, sir, but weeps and weeps; And now falls on her bed; and then starts up, And quench the fire of your nine lives; that I dream it so? Or am I mad, hearing him talk of peace! I hate the word, As I did yet behold! O day! O hateful day! Never was seen so black a day as this: O woful time! CAPULET Death, that hath lain these two days buried. Go, tell the prince: run to the purpose. Signior Romeo, bon jour! there's a French salutation to your father's? we'll to church o' Thursday, tell her, She shall be short in our five wits. ROMEO And is it now To Lammas-tide? LADY CAPULET and Nurse CAPULET When the sun under the dove-house wall; My lord and you shall bear the burden soon at night. Go; I'll to my teeth be it spoken, I have watch'd ere now All night for lesser cause, and ne'er been sick. LADY CAPULET