I wanted to write a blog post, but inspiration seemed a little thin on the ground. I thought I’d try rolling the dice with a creative commons search on Flickr, and I ended up with this handsome chap strutting across some pavement. Sadly, magnificent as he is, he failed to provide much in the way of motivation, but here I am. I’m really intending to get back to writing here on at least a semi-regular basis. I know from doing Blaugust a couple of years ago that I’ve got at least 15 – 20 blog posts a month in me, it’s just a case of digging them out.

One thing that usually gets me writing regularly is being heavily involved in my game of the moment, but there isn’t one right now. I’m still slowly plugging away at World of Warcraft, and while I’m enjoying Legion in general, I’m finding the constant treadmill of grinding AK / AP / Order Resources / World Quests to be a bit of a bore. It feels more and more like logging in is a chore, and that every time I do, I’m only choosing which content to ignore this week. I’m not playing enough to get everything done, and I don’t feel any real urge to play more, either.

This general feeling of dissatisfaction has brought me to a point where I’m thinking of dropping my subscription in favour of Final Fantasy XIV again. I keep remembering how much fun the fishing and crafting jobs are, and how cute my little lalafell fisher/healer is. I mean, really:

My only other gaming thought is to start a playthrough of Avernum: Escape from the Pit on my ageing and somewhat decrepit iPad. The Avernum games are remakes of the old Exile series; Exile II was one of the first RPGs I ever played. I didn’t even have the full version, just the shareware demo, but I played it over and over, not really understanding the mechanics, just wandering around and eventually getting eaten by giant salamanders or slaughtered by roving packs of goblins. It might be fun to go back and see if I can hack (and slash) it now that I know how a tactical RPG is meant to be played.

Spruced up the design a bit, and I found it can do these nice microblog-style “aside” posts. Going to find a way to automatically cross-post these post types to Twitter, I think.

Shakespearean sonnets, remixed

Last week, Matt the Suited Librarian challenged me to write a bit of code to automagically generate Shakespearean sonnets. Well, perhaps challenged is a bit strong — the idea came up in conversation, and I leapt at the idea. It’s been a while since I coded anything new.

First of all, I had to find a complete collection of Shakespeare’s sonnets, preferably in plain text. I ended up going with this collection from the Internet Archive. Next, I wrote a quick script to chop that longer file up into a collection of files, each one containing a single sonnet. In doing so, I discovered that Shakespeare wrote two sonnets that bend the rules slightly — one with one too many lines, and another that’s a line short. Still, when you’re The Bard you can afford to take a couple of literary liberties.

With my corpus collected, I started on the main generator. It randomly picks three sonnets, and then interweaves the lines from the first two picked, so that the lines of prose alternate between the two original sonnets. By only using two sonnets, the rhyming scheme is preserved, and the overall themes of the two still (sometimes) show through, meaning the results are not always complete garbage. The third randomly picked sonnet provides the closing rhyming couplet, so the endings do admittedly tend to be non sequiturs.

Here’s an example sonnet:

How careful was I when I took my way,
When that churl Death my bones with dust shall cover
That to my use it might unused stay
These poor rude lines of thy deceased lover,

But thou, to whom my jewels trifles are,
And though they be outstripp’d by every pen,
Thou best of dearest, and mine only care,
Exceeded by the height of happier men.

Thee have I not lock’d up in any chest,
‘Had my friend’s Muse grown with this growing age,
Within the gentle closure of my breast,
To march in ranks of better equipage:

Presume not on th’heart when mine is slain,
Thou gav’st me thine not to give back again..

It veers into gibberish, but you get the gist: aging and death and deceased lovers, all very Shakespearean woe-is-me. If you want to read some more (why?) the generator is online here, just reload the page for a new sonnet each time.