Because of its repetition and logical non-sequiturs, Waiting for Godot is a very fun text to recombine based on Markov chain patterns. Drama as a genre is especially rich for the most rudimentary of text alteration algorithms because for the most part only one language register is at work: dialogue. No descriptions, no thoughts, no actions — and on top of that, each piece is clearly tagged to its speaker.
After being turned on to Markov chains by Joseph Moore when I first moved to New York, the first easily adaptable piece of code I found online was written in a scripting language called Lua. I first rigged it to produce new versions of Waiting for Godot beginning with the first line and ending with ‘Curtain’. You can find an example in the sidebar to the right.
The next quick hack was to make it interactive so that you could speak for one of the characters. Click here to download the script and source text. Click here for help installing the Lua interpreter on your machine. I have not refined this code at all since that first night many months ago so please read the following caveats:
- When you type in something it can’t respond to, the program defaults to starting the next line with “He said…”
- It doesn’t filter well for stage directions, which is something I would like to improve, as well as perhaps add some sort of ability to track who is “on stage.”
- It remembers what you say and how the computer responds meaning that you can organically change the conversation to no longer be the script from the play. It also means that the “He said…” sentences get continually reinforced if you keep typing sentences that it can’t respond to.
Here are some basic strategies for “playing:”
- Start your own sentences with “He said” so that the computer has more to choices than “He said by the tree.”
- End your lines the same way the computer ends its lines.
- Use objects from the play in your lines (as well as any others you come up with): a carrot, a whip, pants, boots, the tree, etc… The trick is to fuse the vocabulary you want to talk about with the vocabulary the computer knows as given.
There is no point to this game, though I suppose a fun challenge would be to see if you could corner the text into a state where Godot actually comes. Hopefully I will be working on making the Markov engine more sophisticated for use both in this as well as the Hunger game sometime in the near future.
Stop Waiting For It
I’ve put the script for Wait For It, a short little command line amusement for reenacting “Waiting for Godot,” up online. It is not particularly impressive right now and you need the Lua interpreter to run it, but I hope to make this something that can be run in the browser and to make the […]