Re: YN golf

2008-04-11 Thread shmem
From the keyboard of Uri Guttman [31.03.08,17:50]: 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

Re: YN golf

2008-04-01 Thread Philippe Bruhat (BooK)
On Mon, Mar 31, 2008 at 11:37:05PM -0500, Chris Dolan wrote: On Mar 31, 2008, at 6:54 PM, Philippe Bruhat (BooK) wrote: On Mon, Mar 31, 2008 at 04:34:58PM -0700, Rick Klement wrote: perl -le 'print for glob{Y,N}x5' Of course you have to run this in a directory that doesn't contain any file

Re: YN golf

2008-04-01 Thread John W. Krahn
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

RE: YN golf

2008-04-01 Thread Allen, Greg
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

Re: YN golf

2008-03-31 Thread Rick Klement
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

Re: YN golf

2008-03-31 Thread Philippe Bruhat (BooK)
On Mon, Mar 31, 2008 at 04:34:58PM -0700, Rick Klement wrote: perl -le 'print for glob{Y,N}x5' Of course you have to run this in a directory that doesn't contain any file matching /^[YN]{5}$/. -- Philippe Bruhat (BooK) The learned man makes a mistake but once... but the truly stupid

Re: YN golf

2008-03-31 Thread Zed Lopez
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

Re: YN golf

2008-03-31 Thread Chris Dolan
On Mar 31, 2008, at 6:54 PM, Philippe Bruhat (BooK) wrote: On Mon, Mar 31, 2008 at 04:34:58PM -0700, Rick Klement wrote: perl -le 'print for glob{Y,N}x5' Of course you have to run this in a directory that doesn't contain any file matching /^[YN]{5}$/. Not true. The {} notation doesn't