Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Is perl faster than 100 monkies?

by dr_lambado (Hermit)
on Oct 05, 2001 at 22:43 UTC ( [id://117076]=obfuscated: print w/replies, xml ) Need Help??

<html><body>

I was fascinated by the statement "If 100 monkies were sat at 100 typewriters, given an infinite ammount of time one would type the script to Hamlet" I wondered whether perl could do it quicker than infinity on a smaller scale....

#!/usr/bin/perl -w $monkey="japh";@monkee=(32..127);do{$monkie="";do{$monkies=chr$monkee [rand@monkee];$monkie.=$monkies;$yeknom=length$monkie;}until($yeknom eq"4");$eiknom++;}until($monkie eq $monkey);print"$monkie in $eiknom"

Not very obfuscated, I know, but it's my first obfu :)

The Evil but Fickle Dr Lambado
Time waits for no man, unless you have a back button.

Replies are listed 'Best First'.
Re: Is perl faster than 100 monkies?
by tstock (Curate) on Oct 06, 2001 at 20:59 UTC
    I always thought it would be cool to see if a 100 monkies could make a perl script. Something like:

    1. type random text
    2. eval code (could be a `rm -rf *`, but hey, live a little)
    3. save code if eval is good
    4. back to 1
    I never tried to implement this because I was afraid that it would steal my job :)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: obfuscated [id://117076]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-24 23:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found