11.29.2019

N a n o g e n m o

Nanogenmo: 50,000 words of computer generated text.

This is my second time writing this post.  Blogger has a nice auto-save feature, which has cursed me into writing this all over again.  Also, I'm still using Blogger, which I started 10 years ago.

So again....

Academic papers were painful.  The length requirements made me cringe and procrastinate until I floated through the halls of school like a maple leaf passed its prime.  One day, during my sophomore year in high school my lit teacher was passing back our assignments.  When she dropped mine off at my desk, she sternly proclaimed I increased the font size to make my text appear longer.  To my defense, I only changed the size of the punctuation marks but I was ignorant to the fact it would alter the spacing as well.

The next year, I took a creative writing class because it had an allure to it.  All the quirky, down-to-earth teachers taught classes like that and I wanted an environment where I could explore.  At the time I was actively rebelling against my parents urge to pursue computers as it makes "good money and I'll have a stable future".  I took the computer courses to make them happy and creative courses because I enjoyed them.  You could say my introduction to coding, design, and expression started to bud then.

After many years in dabbling in the driest of computer courses and the eccentric arts I've arrived here.  A course that seems familiar but there is still a learning curve.  It took me over week to find something I could mash together through a computer to crank out a novel.  The length requirement started to rekindle both fond and traumatic memories of school.  I decided to use my past works as creative food.

Python is a programming language I wanted to become familiar with next.  After being able to flex my personal perspective into JavaScript and C++ it felt like the next logical step.  I re-watched part 1 of the Jupiter Notebook tutorial over and over until it sunk in.

Starting with setting global variables I tweaked the example code to:

line = int(random.randrange (4) + 2)

It's simple, but learning where to put the int prefix was an accomplishment for learning the syntax.

I wanted to use this variable to create variation in how many words there would be in each line.  So rather than it being only 3 or 4 words per line, the randomness could induce a better rhythmic quality.  I tried using the variable in a for loop and it to worked in the 'selected' field.  However, when I put it in the range to accurately make 50,000 words it drew an error requiring an integer.  This is when I made the variable into an int.

for i in range (50,000/line):

It drew the same error.  I was getting remainders with my random line generation of 3's and 4's.   I wanted 3 and 4 word lines because it looked better than other number combinations.

I conceded and went with 4 words per line to make the math easier for me.


This text is generated from my fiction works written back in 2008-09.

 Nanogenmo

No comments: