Random story generation
I’m trying this blog out. I don’t know how to blog. I don’t know what a blog is, or what’s done to it, my English is brokenen sometimes(but that’s ok), I don’t know why I blog, I don’t know if people read it(but that’s not a problem to me right now), but I’m doing it, I’m testing it.
So I was on vacation and I was bored and I thought: How could a computer make a story for you that’s random every time and does not have the same structure? I started coding something simple immidiately. The output was this:
one day, Harry saw a magic laptop. Harry ignores the laptop. the laptop eats Harry. Harry eats the laptop. the end.
And later
one day, Peter saw a milk. the milk eats Peter. the milk eats Peter. Peter yells at the milk. the end.
(Or try it yourself
Quite stupid and funny. It’s very predictable thought. The code is something like this:
mc = main character = random name
sub = subject = random name
tsub = "the " + subject
print "one day, " + mc + " saw a " + random or no adjective + " " + sub
3 times:
50%: print tsub + " " + random action + " " + mc
50%: print mc + " " + random action + " " + tsub
print "the end"
(I should’ve just posted the javascript, shouldn’t I?)
Cool ‘n stuff, but now it needs to be an actual story.
I’m going to try! If you want to fork, it’s here.
Oh and see the name of the repo tripping-bear
? Github generated that for me. It somehow really fit, so I kept it.