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   

Babbliness:    Output length:   

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 the parties of suspicion. FRIAR LAURENCE So smile the heavens to smile upon my state, Which, well thou know'st, is cross, and full of wretchedness, And fear'st to die? famine is in thy chamber: Take thou that: Live, and be gone. Nurse Honest goodfellows, ah, put up, put up; For, well you know, this is wisely done. Exit JULIET O shut the door! and when thou wast not there for the world begun. BENVOLIO Tut, you saw her laid low in her best array; But, like a portly gentleman; And, to sink in it, should you fall into so deep as a lamb. Go thy ways, wench; serve God. What, have you dined at home? JULIET No, no: this shall slay them both: Therefore, out of the town, Suspecting that we both were in a name? that which thou at once wouldst lose. Fie, fie, thou shamest the music of sweet news By playing it to my dug, Sitting in the sun: didst thou not laugh? BENVOLIO No, coz, I rather weep. ROMEO Good morrow to thy lord. JULIET Love give me thy hand: This is not the friend Which you weep for. JULIET Madam, I am too bold, 'tis not to bed to-night; let me tell ye, if ye should lead her into a new-made grave And hide me with Juliet. Where be these enemies? Capulet! Montague! See, what a head have I! It beats as it will, Some five and twenty years; and then on Romeo cries, And then in post he came from Mantua To this same place, to this vault to die, If