October 28, 2002

Programming...

More programming... Yea... But this time it's no so bad. Kinda funny actually. The program generates random sentences based on a set of given grammars. HUH? Here:

The {noun} {verb} the {noun}.

Thats the format of a grammar. {noun} and {verb} are replaced by other things listed as nouns and verbs in the text file. What is funny about all of the is that the program creates completely random (and very funny) sentences...

Here's the output from a "How-They-First-Met" grammar file:
Margaret Thatcher was working as an animal groomer(specializing in iguanas), and Michael Jackson was by a happy coincidence, buying some liver and onions across the street. Just returning from the beach, he noticed the gulls circling what turned out to be her dining alone. Never the one to miss a chance for sex, Snookims, that what she called him, gave her his corny pickup line. The snare was set and she had no escape, she was caught like a deer looking into the headlights of his love. The students of Plato's teachings give us a charming idiom," It takes more than All the trees in the forest to build a great ox yoke."

Running it again, produces a completely different (and strange) sentence:
Queen Beatrix, just in from the Netherlands, was working as a customs inspector at the airport, and Tony Curtis was in town for a new tattoo. He noticed her while attending the premiere of a Rock Hudson movie. Never the one to miss a chance for sex, that sly dog told her they were meant to be lovers. Pandemonium ensued as they begin to ravage each other wildly. In reality it was never meant to be. It happened as was written in the Old Testament," Mint and bean curd make a drink that sweetens the bladder."

The kewl thing is if I can make up my own funky grammar, I can get extra credit. Guess I should write the program first, huh? =)

Posted by Geek at October 28, 2002 03:56 PM

Trackback Pings

TrackBack URL for this entry:
http://www.unknowngeek.com/mt-tb.cgi/97


Comments

Post a comment




Remember Me?






Subscribe to This Entry