Home  |  Linux  | Mysql  | PHP  | XML
From:Zed Lopez Date:Mon Mar 31 17:22:08 2008
Subject:Re: YN golf
On Mon, Mar 31, 2008 at 05:50:24PM -0500, Uri Guttman wrote:
> perl -le 'print join "\n", map {tr/01/NY/; $_} map unpack( "b5", chr), 0 .. 31'

Also, I'm sure, easily bested:

perl -e 'for(0..31){$_=sprintf"%05b\n",$_;y/01/YN/;print}

marginally shorter not-to-hoyle hybrid: 
seq 0 31|perl -pe '$_=sprintf"%05b\n",$_;y/01/YN/'

--
zed at-sign apricot dot com                      http://www.MemeMachineGo.com/
Zed Lopez PO Box 12546 Berkeley CA 94712

Navigate in group perl.fwp at sever nntp.perl.org
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by PHP Developer
Powered By PHP Consultants