develooper Front page | perl.golf | Postings from November 2007

Re: Just chipping in...

Thread Previous | Thread Next
From:
Tuomo Salo
Date:
November 20, 2007 09:04
Subject:
Re: Just chipping in...
Message ID:
47431167.7050207@plenware.fi
-----BEGIN PGP SIGNED MESSAGE-----

- From the keyboard of Tuomo Salo (2007-11-19 17:52):
> From the keyboard of Phil Carmody (2007-11-15 15:05):
>> I saw this on sci.math, and thought "one liner" ;-)
> 
> While I could not squeeze this down to a one 80 char line,

Scratch that!

Trading (any) performance and utility (whatsoever) for brevity, here's
finally a one liner version:

#!perl -l
$r=qr/4(??{$r})*2/;s/^$r*$/y*42*()**print/efor($=x=pop)/2..$=

Not only accomplishing the given task, this little script will also use
up all your CPU and more! Use argument 4 for extra sluggishness!

Argument >= 4 will even overflow the counter variable to protect your
precious processor cycles!

  -bass
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iQB1AwUBR0MRZ/bPZUB64qcJAQH6oAL/dTSy5U6q0+XCdRizhPC9QV381Lpwja+X
0fZn3IUP9q7ez85RF0j4CP4DSUVbZGNVGnqqNICbNQZo+I2IswG1ZULLtHqiRMkm
E5Mq4U7wULsYqVcUPmGvsnz+B8AWA6OG
=lT/i
-----END PGP SIGNATURE-----

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About