NaNoGenMo / 2019

National Novel Generation Month, 2019 edition.
97 stars 5 forks source link

Lucifer Bimbisara or Francois unsuperscribed, a #NNNGM #111

Open lee2sman opened 4 years ago

lee2sman commented 4 years ago

This is my second Nano-NaNoGenMo entry for 2019 #NNNGM

I wrote a Fish shell script (a fishscript?), thus the .fsh extension, and used the built-in Linux/BSD words, propernames and connectives wordlist files that come pre-installed on almost all machines. A good bit of the challenge for me was practicing and debugging getting the exact right fish shell scripting to work with bash programs, and then figuring out some code golf to get the thing under 255. I could definitely shave more off. One of the quickest ways I did it was using a ton of piping/redirection instead of variables, and moving the word files into the same directory instead of listing their full path. I could have also renamed those files which would have shaved off a lot more, but i was under 255 so that was good enough for me.

I have a full writeup of my methoodology and simple sub-255 character script and novel output here in a Gist.

The script

for q in (seq 16667 -1 1)
    cat propernames | head -(random 1 1308) | tail -1 | tr '\n' ' '>>o
    cat words | head -(random 1 235886) | tail -1 | tr '\n' ' '>>o
    cat connectives | head -(random 1 150) | tail -1 >>o
end

Sample output

Lucifer Bimbisara or Francois unsuperscribed did Neal prudish mr Manuel hypalgia make Eddie anomaloflorous even Ilya gummous man Mott zoea against Peter flunkyite which Santa leafboy she Mott brob time Danielle turnipwise is Lui menorrhagic me Rafael Powhatan take Spock Sikkimese did Naresh went from Gregor wedset both Piete circovarian another Hui inhalant so Robert pictured good Nhan chafer these Niels anorthosite also Terry nonbankable we Jelske elderbrotherly where Mario cohere came Ronald Leonist made Leila poppel way Emma jaunce little Miles cacochymic man Walter otiorhynchid more