Re: YN golf

shmem <[email protected]> Fri, 11 Apr 2008 11:25:54 +0200 (CEST)
Newsgroups gmane.comp.lang.perl.fun
Message-ID <[email protected]>
From=20the keyboard of Uri Guttman [31.03.08,17:50]:

>=20
> 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.
>=20
> 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.
>=20
> golf away!
>=20
> uri
>=20
> perl -le 'print join "\n", map {tr/01/NY/; $_} map unpack( "b5", chr), 0 =
=2E. 31'

from mtve:

  perl -le 'y/12/NY/-5||print for 0..2x5'

(can't do any better...)

0--gg-

--=20
_($_=3D" "x(1<<5)."?\n".q=B7/)Oo.  G=B0\        /
                              /\_=AF/(q    /
----------------------------  \__(m.=3D=3D=3D=3D=B7.(_("always off the crow=
d"))."=B7
");sub _{s./.($e=3D"'Itrs `mnsgdq Gdbj O`qkdq")=3D~y/"-y/#-z/;$e.e && print=
}