Home  |  Linux  | Mysql  | PHP  | XML
From:Rick Klement Date:Mon Mar 31 17:34:58 2008
Subject:Re: YN golf
Uri Guttman wrote:
> 
> someone posted (and it wasn't homework) for an easy way to get all
> possible combos of YN (5 chars so 32 answers). he got some basic
> multiline answers but i think it makes for a great golf problem.
> 
> here is my first pass which i am sure can be easily bested. i haven't
> even squeezed out the white spaces but it does work.
> 
> golf away!
> 
> uri
> 
> perl -le 'print join "\n", map {tr/01/NY/; $_} map unpack( "b5", chr), 0 .. 31'
> 
> --
> Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
> -----  Perl Code Review , Architecture, Development, Training, Support ------
> --------- Free Perl Training --- http://perlhunter.com/college.html ---------
> ---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

perl -le 'print for glob"{Y,N}"x5'

-- 
Rick Klement
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