[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Golf (7 strokes is par!)



"Larry Rosler" <lr@hpl.hp.com> writes:

> > From: Ilmari Karonen [mailto:iltzu@sci.fi]
> > Sent: Monday, May 01, 2000 11:23
> > To: Ariel Scolnicov
> > Cc: fwp@technofile.org
> > Subject: Re: [FWP] Golf (7 strokes is par!)
> >
> > On 1 May 2000, Ariel Scolnicov wrote:
> > > Jeff Pinyan <jeffp@crusoe.net> writes:
> > > > Challenge: determine if $_ is an integral power of 2
> > (1,2,4,8,16,...)
> > > > I have it down to 7 characters.  Can anyone beat that?
> > >
> > > print"$_ is a power of 2"unless$_&$_-1;
> >
> > Another answer with 7 strokes: $_&~-$_
> 
> I just posted a long article to c.l.p.misc and c.l.p.moderated, stating
> why I think this expression may be ambiguous.

I think you misread it as $_&--$_.

-- 
Ariel Scolnicov        |"GCAAGAATTGAACTGTAG"            | ariels@compugen.co.il
Compugen Ltd.          |Tel: +972-2-6795059 (Jerusalem)	\ We recycle all our Hz
72 Pinhas Rosen St.    |Tel: +972-3-7658514 (Main office)`---------------------
Tel-Aviv 69512, ISRAEL |Fax: +972-3-7658555    http://3w.compugen.co.il/~ariels

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe