Magoo! -----Original Message----- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 01, 2008 7:17 AM To: fwp@perl.org 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' perl -le'y/01/NY/&&print,for+map+unpack(b5,chr),0..31' John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of tools at low cost and in short order. -- Larry Wall - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This message is intended only for the personal and confidential use of the designated recipient(s) named above. If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited. This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers. Email transmission cannot be guaranteed to be secure or error-free. Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such. All information is subject to change without notice.