[{"data":1,"prerenderedAt":192},["ShallowReactive",2],{"content-/blog/fairy-tale-generator":3,"authors":175},{"article":4,"surround":162},{"id":5,"title":6,"author":7,"body":8,"date":140,"dateUpdated":141,"description":142,"excerpt":141,"extension":143,"headline":144,"meta":145,"navigation":147,"path":148,"seo":149,"socialImage":150,"stem":156,"tags":157,"__hash__":161},"blog/blog/fairy-tale-generator.md","Fairy Tale Generator, Still Running","Michael Paulukonis",{"type":9,"value":10,"toc":137},"minimark",[11,15,18,21,27,30,37,48,57,65,72,75,78,81,123,126],[12,13,14],"p",{},"NaNoGenMo (National Novel Generation Month) has one rule: write code that produces a 50,000-word novel. Not a good novel. A novel-shaped pile of words that have been piled up by code, not by hand. And believe me - the code is often not much better than the novel quality.",[12,16,17],{},"I built \"Malepropp\", aka \"Fairy Tale Generator\", for my second run at NaNoGenMo in 2014, and it's still limping along years later, which is either a testament to something or an indictment of everything.",[12,19,20],{},"The git logs contain this gem from 2019:",[22,23,24],"blockquote",{},[12,25,26],{},"Relocated an ancient version of nlp_compromise that worked. Ugh this code is awful.",[12,28,29],{},"/",[12,31,32],{},[33,34],"img",{"alt":35,"src":36},"proppian fairy tale generator UI, with function checkboxes and a generated story below","/media/blog/fairy-tale-generator/fairy-tale-generator.screenshot.png",[12,38,39,40,47],{},"The scaffold came from ",[41,42,46],"a",{"href":43,"rel":44},"https://en.wikipedia.org/wiki/Vladimir_Propp",[45],"nofollow","Vladimir Propp",", the Russian folklorist who broke fairy tales down into a fixed set of recurring components — the villain does villainy, the hero leaves home, a magical helper shows up. Propp's morphology reads like a fairy tale's skeleton with the meat stripped off, which looks like a gift to anyone trying to generate one programmatically — except Propp never built it as a generator. He was describing patterns already present in existing stories, not handing out a recipe for new ones.",[12,49,50,51,56],{},"I also found a ",[41,52,55],{"href":53,"rel":54},"https://web.archive.org/web/20061112014356/http://www.brown.edu/Courses/FR0133/Fairytale_Generator/gen.html",[45],"poetical rendering of Propp's components"," — someone's phrasing of each function as an evocative fragment rather than a dry taxonomic label. That turned out to be the actual trick. The fragments were specific enough to feel like they belonged to a story and vague enough that almost anything could follow them without breaking. Selected and stitched together, they cohered the way dreams cohere.",[12,58,59,60,64],{},"It's what I based my first version on (and the web version ",[61,62,63],"em",{},"still"," looks like it). But plain templating is a blunt instrument for something with a fairy tale's structure. Slotting phrases into fixed positions gets you sentences; it doesn't get you a shape that reads as a story building toward anything. I fought that mismatch instead of solving it. I got a working generator, not a good one — and I was writing this in JavaScript I'd generously describe as \"learning as I went,\" which didn't help. As is often the case, my solution to structural issues is \"more of the same\" instead of pruning.",[12,66,67,68,71],{},"So I kept bolting things on. Over the next year or two, whenever an idea seemed like it'd make the output more interesting, it went in, with basically no regard for whatever structure the code had going in. At the time I had little to no understanding of JavaScript modules, but I wanted code that would work both in Node and in the browser. And it does! It just looks (and is) ",[61,69,70],{},"awful",".",[12,73,74],{},"There hasn't been a commit in years, and it still runs — in a browser. It fires up and generates a fairy tale on command, same as it did the day I abandoned it. Granted, it mainly relies on string manipulation and concatenation, concepts that haven't changed much in JavaScript, though template literals came along since. It's not like I was relying on Flash or anything weird.",[12,76,77],{},"I've been using Claude Code to refinish it. While not dead, it might still be coming back to (a better) life!",[12,79,80],{},"Links:",[82,83,84,93,100,108,116],"ul",{},[85,86,87,92],"li",{},[41,88,91],{"href":89,"rel":90},"https://michaelpaulukonis.github.io/malepropp/",[45],"malepropp"," — live version",[85,94,95],{},[41,96,99],{"href":97,"rel":98},"https://github.com/MichaelPaulukonis/malepropp",[45],"source",[85,101,102,107],{},[41,103,106],{"href":104,"rel":105},"https://fairytalesbot.tumblr.com/",[45],"FairyTalesBot"," — the Heroku-hosted bot stopped running in 2021; I hope to bring it back to life soon",[85,109,110,115],{},[41,111,114],{"href":112,"rel":113},"https://github.com/dariusk/NaNoGenMo-2014/issues/6",[45],"discussion during construction",", NaNoGenMo 2014",[85,117,118],{},[41,119,122],{"href":120,"rel":121},"https://github.com/MichaelPaulukonis/NaNoGenMo2014/tree/master/propp.gen",[45],"NaNoGenMo 2014 entry",[12,124,125],{},"Sample story:",[127,128,133],"pre",{"className":129,"code":131,"language":132},[130],"language-text","HEARTY OAKLEY\n\nIn the middle of the night in Belorechensk, a very unmotivated dragon known as Jessica the Unmotivated strode in.\n\nJessica attempted to deceive victim.\n\nThere was once an old shack that stood in the middle of a deep gloomy Belorechensk, and in the shack lived Oakley.\n\nOakley unwittingly helped Jessica.\n\nThe harvest was destroyed by Jessica. All in the Monastic State of the Teutonic Knights began to feel the pangs of hunger.\n\nOakley left shack to cut down the tallest tree in the forest with a herring.\n\nOakley was challenged to prove heroic qualities.\n\nOakley responded to this test.\n\nHearty Oakley found Confident Santa Claus.\n\n\"Gods be with you Confident Santa Claus\" mused Oakley.\n\n\"Greetings, Oakley\" replyed Confident Santa Claus.\n\n\"Well, you certainly are confident,\" said Oakley.\n\n\"Yes, I am,\" conceded Confident Santa Claus. \"But it's been said that I'm also courageous!\"\n\n\"Here,\" said Santa Claus, \"you'll need this,\" and gave Hearty Oakley the Finite Shield.\n\n\"What's this?\" asked Hearty Oakley.\n\n\"What does it look like?\" replied Santa Claus. \"It's a special, magical Finite Shield. Perhaps you can use it in your struggle with Jessica the Unmotivated.\"\n\n\"Thanks!\" said a grateful Oakley.\n\nHearty Oakley set out for her shack.\n\nSo she went and had a goodish drink, and then started in search of Belorechensk.\n\nOakley's horse smote Katherine full swing with its hoof, and cracked her skull, and Hearty Oakley made an end of her with a club. So Oakley cut her into small pieces, which were buried throughout the woods. Katherine sits to this day in the pit - in Tartarus.\n\nAll of this took place long before you were born, so it's not surprising that you don't remember it. But it happened, and people speak of it still.\n","text",[134,135,131],"code",{"__ignoreMap":136},"",{"title":136,"searchDepth":138,"depth":138,"links":139},2,[],"2026-08-10T00:00:00.000Z",null,"2014 project built on Propp's morphology turned into years of bolted-on hacks that, somehow, still runs.","md","Fairy Tale Generator still works",{"authorUrl":146},"https://michael.paulukonis.github.io/",true,"/blog/fairy-tale-generator",{"title":6,"description":142},{"src":151,"mime":152,"width":153,"height":154,"alt":155},"/media/blog/fairy-tale-generator/fairy-tale-generator.thumb.png","image/png",512,332,"Screenshot of the generator's output, the story \"HEARTY OAKLEY\"","blog/fairy-tale-generator",[158,159,160],"generative-text","nanogenmo","fairy-tales","cwy7r1vE6V28NnTejAs1fUfkaGoIVFa0_47rqQ5igIk",[163,169],{"title":164,"path":165,"stem":166,"headline":167,"description":168,"excerpt":141,"children":-1},"DuoChrome and friends","/blog/duo-chrome","blog/duo-chrome","DuoChrome and company","A browser-based suite that generates combinations of two images",{"title":170,"path":171,"stem":172,"headline":173,"description":174,"excerpt":141,"children":-1},"IA Book Page Downloader, a Chrome extension","/blog/ia-book-page-downloader","blog/ia-book-page-downloader","Archive.org page downloader","A Chrome extension for downloading full-resolution page scans from the Internet Archive",{"id":176,"avatar":141,"bio":141,"extension":177,"meta":178,"name":141,"social":141,"stem":190,"__hash__":191},"authors/authors.json","json",{"path":179,"Sample Author":180,"body":187,"title":189},"/authors",{"@context":181,"@type":182,"@id":183,"name":7,"alternateName":7,"nationality":184,"gender":185,"jobTitle":186,"url":183},"http://www.schema.org","Person","https://michaelpaulukonis.github.io/","American","male","Senior Software Engineer, full-stack dev, backend-focus",{"Sample Author":188},{"@context":181,"@type":182,"@id":183,"name":7,"alternateName":7,"nationality":184,"gender":185,"jobTitle":186,"url":183},"Authors","authors","gDLa0t2oQBqkm4ZjFHa3UMLJv3dsBGcc4djngSH_b-Q",1786421668675]