develooper Front page | perl.fwp | Postings from January 2002

Re: solutions

Thread Previous | Thread Next
Stephen Turner
January 29, 2002 03:12
Re: solutions
Message ID:
On Tue, 29 Jan 2002, Peter Makholm wrote:

> Stephen Turner <> writes:
> > Oh, also 7-9*index instead of 4*2**index loses a stroke and passes the test
> > suite but doesn't solve the problem. (In a mail to Andrew, I called this my
> You didn't try do something like '1<<index' which would save you 2
> chars but then you had to do some shifting on the $. part too so might
> sum up.

Or 4<<index. I didn't think of that either, and should have done. But it
doesn't seem to work. index can be -1, and 4<<(-1) seems to give 0. Of
course, 2<<(index+1) is too long.

Stephen Turner, Cambridge, UK
"This is Henman's 8th Wimbledon, and he's only lost 7 matches." BBC, 2/Jul/01

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About