On Fri, 17 May 2002, Ton Hospel wrote:
> Unfortunately you don't. This solution misses the requested \n, fixing
> that makes it a 46
OK, thanks. I was getting a new line after running my program, but I
wasn't sure if the artifact of the way it was run counted or not, and I
didn't see any obvious \n's in the postmortems on the perlgolf site.
Newbie question, why does it only add 3 characters? I would have to add
,"\n" (5) with what (little) I know. Wait...
print"$n\n"
OK, so 4 then.
> >
> > Hang on... can't that be changed to:
> >
> > $m=pop;$n+=$m%$_?0:$_ for 1..$m-1;print$n
To that poster, yes that does work, thanks. Didn't know one could use a
"for" following a function to make it loop, cool.
> >
> > you might be able to get rid of the space between "for 1".
No, needs the sapce.
> > I can't
> > believe you left the space in between "print" and "$n" though!
Doh!
Ryan
(Apologies if I'm being overly descriptive, I figure there might be others
lurking like myself who can use the hints.)