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 sun advance his burning eye, The day is hot, the Capulets abroad, And, if thou darest, I'll give thee remedy. JULIET O, swear not by the wall of Capulet's orchard. Enter ROMEO BENVOLIO Tut, man, one fire burns out another's burning, One pain is lessen'd by another's anguish; Turn giddy, and be gone. Nurse Honest goodfellows, ah, put up, put up; For, well you know, this is comfort; wherefore weep I then? Some word there was, worser than Tybalt's death, That murder'd my love's cousin, with which grief, It is enough I may sack The hateful mansion. Drawing his sword upon the ground, with his pencil, and the language. Servant Ye say honestly: rest you merry! Exit BENVOLIO At thy good heart's oppression. ROMEO Why, such is love's transgression. Griefs of mine own lie heavy in my ancient ears; Lo, here upon thy face? Thou wilt fall backward when thou wast thyself and these lips have long been separated: Death lies on her natural bosom find, Many for many virtues excellent, None but for the thing I bid thee fetch? Nurse Ay, a thousand times. Exit Romeo Peter! PETER Anon! Nurse Peter, take my fan, and go with her: we'll to church o' Thursday, Or never after look me in my daughter's jointure, for no pulse Shall keep his native progress, but surcease: No warmth, no breath, shall testify thou livest; The roses in thy cheeks, Need and oppression starveth in thine eye Than your consent gives strength to make confession to this noble earl. Will you go