King James Programming: Markov chain trained on the Bible and a comp sci textbook

Michael Walker trained a Markov chain with the King James Bible and Structure and Interpretation of Computer Programs, a classic computer science textbook. The result is King James Programming, a tumblr filled with comp-sci-inflected biblespeak. I could read it all day long.

...his brother whom he slew; and we will walk in my statutes, and do them: I am the LORD: I will not lie nor repent: for he is Lord of lords, and King of kings: and they that were burnt had offered; and they were divided hither and thither, so that they operate on “abstract data.”...

12:2 And I will make all my goodness pass before thee, and our sins be upon us, because of our use of not and lisp-value.

And Satan stood up against them in that day, and leap for joy: for, behold, your reward is great in heaven: for he maketh his sun to rise on the evil and on the role of procedures in program design.

Abstractly, we can imagine that the values used for test-divisor should not be made manifest; neither any thing hid, that shall not be as it becometh the gospel of Christ.

King James Programming (via JWZ)

(Image: (KJV) 1631 Holy Bible, Robert Barker/John Bill, London. King James Version, juxtapose^esopatxuj/Wikimedia Commons, CC BY-SA)

Notable Replies

  1. We are one apocalypse away from that becoming the gospel according to Saint Markov.

  2. Sigh. Here's how I spent last night:

    #         FILE:
    #        USAGE:  ./ 
    #      VERSION:  1.0
    #      CREATED:  05/12/2013 20:08:15 GMT
    #     REVISION:  ---
    use strict;
    use warnings;
    use Algorithm::MarkovChain;
    use Path::Class;
    use autodie; # die if problem reading or writing a file
    my @inputs = qw(king_james_bible.txt lovecraft_complete.txt); 
    my $dir = dir(".");
    my $f = "";
    my @symbols = ();
    foreach $f (@inputs) {
        my $file = $dir->file($f);
    	my $lcounter = 0;
        my $wcounter = 0;
        my $file_handle = $file->openr();
        while( my $line = $file_handle->getline() ) {
    		chomp ($line);
    		my @words = split(' ', $line);
            push(@symbols, @words);
    		$wcounter += scalar(@words);
    	print "$lcounter lines, $wcounter words read from $f\n";
    my $chain = Algorithm::MarkovChain::->new();
    $chain->seed(symbols => \@symbols, longest => 6);
    print "About to spew ...\n";
    print "---\n\n";
    foreach (1 .. 20) {
        my @newness = $chain->spew(length   => 40,
                                   complete => [ qw( the ) ]);
        print join (" ", @newness), ".\n\n";

    Exercises for the reader:

    1. Figure out where to get hold of king_james_bible.txt and complete_lovecraft.txt (it's not rocket science)

    2. Tinker with the Markov chain generator


  3. Charlie, mind if we post this?

  4. Markov Chaney once shot a book in the face. He also was CEO of Googleburton for a while, became the Vice President of Stats and drove a Monte Carlo.

  5. I'm blogging it now but you're welcome to share!

    Charlie's Diary blog entry:

    Note that what comes out is pretty much word salad. You'll need to run it for a while and cherry-pick the output to find anything good. Here's a sample run:

    krina:markov charlie$ ./ 2> /dev/null
    99820 lines, 821134 words read from king_james_bible.txt
    16536 lines, 775603 words read from lovecraft_complete.txt
    About to spew ...
    the people came only two boxes in the accustomed metal as
    the hair of women, as many as were of the men were heads of
    the morning, nor did not yield as much as to the outer world
    despite their guest.
    the hills hear thy children within thee. 23:22 These things
    about which is better that are weak, few or none of their
    first month, in me: or mask. We went down in his chariot.
    10:17 And Job answered and said, 9:2.
    the LORD; it lived far from the traces of the amnesia? Had
    my present body and mind alike. I took them away as I saw
    good. 16:51 Neither hath the earth. 57:6 They have deeply
    into the hand of Israel heard.
    the doctor would never speak. To Mr. Ward he said, Take ye
    have been too – not merely a great round red god ascended a
    normal atmosphere in the vine; no more effective than
    materialists in delineating the extremes of the.
    the children of the discipline of our captors, which were
    spoken of Paul. 16:15 And she snapped. "The shadows… there
    is no proof, the deeper into adjuncts of the seemingly
    deserted basement. Dr. McNeill unlocked a greypainted steel
    door, but I.
    the coast turneth to Ramah, and the prince and rejoice
    therefore that she help me, I do not this abominable thing
    that is in it; but thy disciples according unto thy land:
    but remarkable for his mercy endureth for ever. 44:33.
    the mystery of how assiduously he haunts those whom they had
    carried the secret places. The doctor has distinctly assured
    me for all they ever escaped a sense of Greenland and
    Iceland in search of these wonders-and of heart, but ye.
    the wicked shall have profaned among debris which slid down
    through the eons to me. 11:15 But if ye have ought against
    any: that your transgressions are discovered, so that were
    the chief of Joseph. 13:8 And it grieved me thy.
    the memories appeared, I therefore was not given unto him
    the elders of the Jews, and to the hills, ravines, and
    bluffs hemmed in the uniform wetness of my table upon him,
    as hinted by his relatives, wishing to transport our.
    the mists. There were never dead, but of plebeian ignorance,
    since the old fishing town as legend according unto the
    greatness unto our real impulses contrast with sackcloth,
    and went into the inner gate that looketh toward the east,
    and the.
    the blue-winged fly retain Evidently they saw that light old
    spires of Kingsport. Even as it was said that she was in the
    room. It was very exciting the chief gods had rest of the
    heifer shall wash his males an.
    the general disgust which his habits and misalliance had
    declared this day, shall start before the Life touches
    onDolliver Romance, the Elixir of Life touches onDolliver
    Romance, the place – is never got his bow abode of delirium.
    Dream, madness, and.
    the son of David, is risen violently, and I strained passage
    of artificial settings, their coming she is, Prague – quick!
    Get her out of my narrative effects despite a limited amount
    of manufacturing were also practiced. Travel was very

    (That's enough gibberish for now!)

Continue the discussion

10 more replies