Back to the archive

Intro to Go: The Shakesspeare's Monkey Problem

A few weeks ago I had a conversation with a friend of mine about Go, the new C/Python-esk language put out by Google. It sounded like an interesting langauage with well thought-out thread support so I thought I would give it a try.

So I started writing-up a simple simulation of the "Shakespeare's Monkey Problem": how long would it take a series of monkeys with typewriters to produce the works of Shakespeare? In my implementation, a series of threads will produce random character strings (to simulate the monkeys) until one thread has produced the provided string. To further simplify the problem, the "monkeys" will know how long the string should be so the monkey's "manager" won't have to continually check the monkey's work.

The project isn't completed yet, but the basic source code is up. I'll continue to work on it through-out the semester.

The Shakespeare's Monkey Project is available here: GitHub