Skip to content

Instantly share code, notes, and snippets.

View MarksCode's full-sized avatar

Ron Marks MarksCode

View GitHub Profile
/*********************************************************************/
/* Program: Markov ChainMaker */
/* Author: Ron Marks */
/* */
/* This programs applies Markov chains to textual input in order to */
/* generate not-quite-random sentences and words. */
/* */
/* */
/* Input: */
/* Text file as args0 */
Call me Ishmael. Some years ago--never mind how long
precisely--having little or no money in my purse, and nothing
particular to interest me on shore, I thought I would sail about a
little and see the watery part of the world. It is a way I have of
driving off the spleen and regulating the circulation. Whenever I
find myself growing grim about the mouth; whenever it is a damp,
drizzly November in my soul; whenever I find myself involuntarily
pausing before coffin warehouses, and bringing up the rear of every
funeral I meet; and especially whenever my hypos get such an upper
hand of me, that it requires a strong moral principle to prevent me