User avatar
Super-Nathan
Posts: 67
Joined: Sun Jun 17, 2012 6:56 am
Location: South Korea
Contact: Website

GPIO output from "Monkeys with Typewriters" expiriment

Thu Sep 13, 2012 4:31 am

Recently I was sitting around looking at my RasPi and I was thinking, dangerous thoughts.

"Given a long enough timespan, a room full of monleys with typewriters will re-create the entire works of William Shakespeare."

So I wrote a piece of Python code that uses the RasPi like a monkey in a room with a typewriter. The code generates a random set of characters to form a string the same length as a Shakespearian Sonnet. Then if the random string does not match the sonnet, it deletes the first character and adds a new random character to the end and tests again for a match. With the sonnet I am using being 560 characters including spaces long, I am expecting this to take a very long time.

The code is available for DL and or improvement on github:

https://github.com/super-nathan/monkeys-w-typewriters
echo "Something Useful" > /dev/null

User avatar
joan
Posts: 14936
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: GPIO output from "Monkeys with Typewriters" expiriment

Thu Sep 13, 2012 7:00 am

An interesting but ultimately fruitless project.

May I suggest you spend the Pi's time constructing spam e-mails for Viagra. I'm in need of some good quality medication. I just don't trust the sellers based on the quality of the spam in my inbox. :(

User avatar
meltwater
Posts: 1015
Joined: Tue Oct 18, 2011 11:38 am

Re: GPIO output from "Monkeys with Typewriters" expiriment

Thu Sep 13, 2012 7:35 am

:lol: Sounds good fun! Perhaps an extension to the project would be to do it live on a webpage, for a whole play!

Now, back to programming mine to work on the ultimate question of life, the universe and everything to which the answer is 42.
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam

User avatar
Super-Nathan
Posts: 67
Joined: Sun Jun 17, 2012 6:56 am
Location: South Korea
Contact: Website

Re: GPIO output from "Monkeys with Typewriters" expiriment

Thu Sep 13, 2012 11:34 pm

I was getting 2 digit results in under a minute easily!
echo "Something Useful" > /dev/null

toxibunny
Posts: 1382
Joined: Thu Aug 18, 2011 9:21 pm

Re: GPIO output from "Monkeys with Typewriters" expiriment

Fri Sep 14, 2012 1:53 am

have the program check for completed words and save them in that position. repeat until the whole thing is filled, tweet it and start again.
note: I may or may not know what I'm talking about...

Ravenous
Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK

Re: GPIO output from "Monkeys with Typewriters" expiriment

Fri Sep 14, 2012 12:38 pm

toxibunny wrote:have the program check for completed words and save them in that position. repeat until the whole thing is filled, tweet it and start again.
That's a clever idea and a far more interesting exercise. It'll complete sooner for authors who use lots of short words, than for those who use a smaller number of longer words.

Emul
Posts: 5
Joined: Fri Sep 14, 2012 8:24 pm

Re: GPIO output from "Monkeys with Typewriters" expiriment

Fri Sep 14, 2012 8:51 pm

There is already a standard for doing this via distributed computing. The IETF, the agency that creates all of the Internet standards, has a standard for the Infinity Monkey Protocol Suite. It can be found at:

http://www.ietf.org/rfc/rfc2795.txt

Return to “Python”