A simple Markov text generator in 67 lines of C

The first chapter of Alice in Wonderland piped through markov.c produces this:

Alice was not a moment to be two people. But it's no use in crying like that!' said Alice to herself,after such a fall as this, I shall have to ask them what the flame of a candle is like after the candle is blown out, for she could not remember the simple rules their friends had taught them: such as, that a red-hot poker will burn you if you cut your finger VERY deeply with a knife, it usually bleeds; and she was now only ten inches high, and her face brightened up at the thought that she was now only ten inches high, and her face brightened up at the time it all seemed quite natural); but when the Rabbit say to itself, Oh dear! Oh dear! I shall see it pop down a large rabbit-hole under the table: she opened it, and finding it very nice, (it had, in fact, a sort of mixed flavour of cherry-tart, custard, pine-apple, roast turkey, toffee, and hot buttered toast,) she very seldom followed it), and sometimes she scolded herself so severely as to bring tears into her eyes; and once she remembered trying to box her own ears for having cheated herself in a long, low hall, which was lit up by wild beasts and other unpleasant things, all because they WOULD not remember the simple rules their friends had taught them: such as, that a red-hot poker will burn you if you cut your finger VERY deeply with a knife, it usually bleeds; and she was quite surprised to find that she remained the same size: to be two people! Why, there's hardly enough of me left to make ONE respectable person!' Soon her eye fell on a little three-legged table, all made of solid glass; there was no longer to be two people! Why, there's hardly enough of me left to make ONE respectable person!' Soon her eye fell on a little bit, and said anxiously to herself, in a moment: she looked up, but it was empty: she did not like to drop the jar for fear of killing somebody, so managed to put it into one of the well, and noticed that they were filled with cupboards and book-shelves; here and there she saw maps and pictures hung upon pegs. She took down a large rabbit-hole under the door; so either way I'll get into the garden at once; but, alas for poor Alice! when she got to the door, she walked sadly down the middle, wondering how she was walking hand in hand with Dinah, and saying to her great disappointment it was growing, and she tried the little golden key, and Alice's first thought was that it led into a small passage, not much larger than a rat-hole: she knelt down and make out what she was going to shrink any further: she felt a little bottle on it, or at any rate it would not open any of them. However, on the second time round, she came upon a little bit, and said anxiously to herself, in a hurry.No, I'll look first,' she said, and see whether it's marked "poison" or not'; for she had tired herself out with trying, the poor little thing sat down and looked at the thought that she was ever to get very tired of sitting by her sister on the bank, and of having nothing to do: once or twice she had never before seen a rabbit with either a waistcoat-pocket, or a watch to take out of it, and finding it very nice, (it had, in fact, a sort of way,Do cats eat bats? Do cats eat bats?' and sometimes, Do bats eat cats?' for, you see, so many out-of-the-way things had happened lately, that Alice had begun to dream that she was considering in her lessons in the common way. So she set to work, and very soon finished off the top of the well, and noticed that they were filled with cupboards and book-shelves; here and there she saw maps and pictures hung upon pegs. She took down a large rabbit-hole under the table: she opened it, and fortunately was just in time to see if she was now the right distance--but then I wonder what was going to do THAT in a moment: she looked up, but it was a paper label, with the wordsDRINK ME' beautifully printed on it in large letters. It was all dark overhead; before her was another long passage, and the White Rabbit was still in sight, hurrying down it. There was not going to happen next. First, she tried to curtsey as she passed; it was a paper label, with the words DRINK ME' beautifully printed on it except a tiny golden key, and when she turned the corner, but the Rabbit was still in sight, hurrying down it. There was nothing else to do, so Alice soon began talking again.Dinah'll miss me very much to-night, I should think!' (Dinah was the cat.) `I hope they'll remember her saucer of milk at tea-time. Dinah my dear! I wish you were down here with me! There are no mice in the schoolroom, and though this was not a moment to think that very few things indeed were really impossible. There seemed to be lost: away went Alice like the wind, and was just in time to see it written up somewhere.' Down, down, down. Would the fall was over. Alice was not a moment to think about stopping herself before she found she had not noticed before, and behind it was indeed: she was coming to, but it was growing, and she jumped up on to her that she was ever to get out again. Suddenly she came upon a little door into that lovely garden. First, however, she waited for a few minutes to see anything; then she looked at it, and finding it very nice, (it had, in fact, a sort of mixed flavour of cherry-tart, custard, pine-apple, roast turkey, toffee, and hot buttered toast,) she very soon finished off the cake.

/r/tinycode Thread Link - cs.bell-labs.com