Sha256: f666f3c4c47be6737c528525ab3ea4532b0b365b9adcfc338ca480e874bc8618
Contents?: true
Size: 1.03 KB
Versions: 272
Compression:
Stored size: 1.03 KB
Contents
module House let subjects = [("house that Jack built", "lay in"); ("malt", "ate"); ("rat", "killed"); ("cat", "worried"); ("dog", "tossed"); ("cow with the crumpled horn", "milked"); ("maiden all forlorn", "kissed"); ("man all tattered and torn", "married"); ("priest all shaven and shorn", "woke"); ("rooster that crowed in the morn", "kept"); ("farmer sowing his corn", "belonged to"); ("horse and the hound and the horn", "")] let numberOfBlocks = List.length subjects let line number index = let (subject, verb) = List.item (index - 1) subjects let ending = if index = 1 then "." else "" if index = number then "This is the " + subject + ending else "that " + verb + " the " + subject + ending let block number = let lineForBlock = line number [number .. -1 .. 1] |> List.map lineForBlock |> List.reduce (fun x y -> x + "\n" + y) let rhyme = [1..numberOfBlocks] |> List.map block |> List.reduce (fun x y -> x + "\n\n" + y)
Version data entries
272 entries across 272 versions & 1 rubygems