Generic Fantasy Writer Bot

My boyfriend and I have something we call the “David Eddings Game”, where we make up the silliest, most generic fantasy book titles. Stuff like “The Dragon’s Quest” or “The Mage’s Folly”.  Its just based on a sequence of “A-Something’s-Something”, so I thought that it would be pretty neat to make a bot that plays this game.

I created a .csv database of fantasy words, then created a script that would make random sentences out of them.

17

I had four classes – word, sentence, database and generator. From sentence I created three instances of word, one for each row in my csv, and combined them into a sentence. In generator, I used sentence but used some of the functions defined in database to check whether the string had already been created and skip if if so.

18

I then created an account and app for my bot on twitter, had my script create the api and then every time it is run, generate a random sentence and tweet it. A lot simpler than I imagined it would be!

2019

16

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s