Cthulhu Thursday: Coding Cthulhu
This is fun and very, very geeky. Being a fan of the Cthulhu Mythos is quite geeky (until the Hollywood film comes out). Being a programmer is geeky. So writing a coding manual using Lovecart’s ideas, well it’s so geeky there is a danger of an implosion:
I had heard tales of the… thing that C.A.R. Hoare had summoned up in ’62– dark hints of choosing one element from an array, and partitioning the rest into lesser and greater sets, and hellishly recursing until the data were twisted into a sorted list– but nothing I could have imagined would be in any way comparable to the daemoniac, blasphemous reality that I saw.
And yet I saw them in a limitless stream– flopping, hopping, croaking, bleating– sorting themselves inhumanly through the spectral moonlight in a grotesque, malignant saraband of fantastic nightmare. Their croaking, baying voices called out in the hideous language of the Old Ones:
void Rlyeh (int mene[], int wgah, int nagl) { int Ia, fhtagn; if (wgah>=nagl) return; swap (mene,wgah,(wgah+nagl)/2); fhtagn = wgah; for (Ia=wgah+1; Ia<=nagl; Ia++) if (mene[Ia]<mene[wgah]) swap (mene,++fhtagn,Ia); swap (mene,wgah,fhtagn); Rlyeh (mene,wgah,fhtagn-1); Rlyeh (mene,fhtagn+1,nagl); } // PH'NGLUI MGLW'NAFH CTHULHURecursion may provide no salvation of storage, nor of human souls; somewhere, a stack of the values being processed must be maintained. But recursive code is more compact, perhaps more easily understood– and more evil and hideous than the darkest nightmares the human brain can endure.
(Hat-tip to Boing Boing.)
(Cthulhu Thursday is a dose of mythos to brighten darken your week. More on the idea can be found here and a list of posts thus far, here. Enjoy!)