A million monkeys typing the works of Shakespeare.
A Kotlin project to simulate the random typing of one million monkeys, to match the complete works of Shakespeare, with intermediate output and progress.
There is much debate about what it means to create the works. I've read one where the criterion was for each seven-character sequence to be sought in any seven-character sequence within the canon, and if it matches, then the sequence is matched.
Interesting, and a fascinating map-reduce scenario, but that's not what I think people mean.
In this project, the idea is that a monkey types a complete sentence -- random characters until hitting a period. That sentence is then virtually printed off on a scrap of paper and sent to a curator of Shakespearean works, and if that scrap matches a full sentence within the canon, then there is a match.
Yeah. That's going to take a while.
And if that sounds similar to the scenario in the Professor and the Madman, that's intentional.
So in the interim, this project will also match against subsets of the canon -- individual works, and famous lines.
I'm writing this project to satisfy my own curiosities, one being the feasibility of that often-repeated phrase, and the other to learn Kotlin.
So if you're a Kotlin expert (compared to me, that's someone with more than a few weeks of experience), then feel free/encouraged to send feedback about how to improve this. Obviously this project makes much usage of coroutines, so that should be focused on.
I appreciate your interest in this project, and I hope you find it interesting.
No monkeys were harmed in the production of this project.