in reply to Triangle Golf
102, including the newline ;)$c=(@ARGV,$/)='ctriangle.txt';$_=<>.$";y/ / /s;print$"x(40-($c=length$&)/2),"$&\n"while/.{1,$c}.*? /g
update: changed two ' ' to $", saving an additional two characters - liberally aped from jeroenes node :-)
update2: shuffled the $/ assignment into the list assignment, saving another extra char.
MeowChow s aamecha.s a..a\u$&owag.print
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Triangle Golf
by petral (Curate) on Apr 25, 2001 at 21:15 UTC | |
a perfectly respactable program, about 140 chars (after the #!.../): > triangle.pl a.txt w.txt a one-liner, 74 chars (+6 extra flag chars): and pretty well golfed, 66 chars (+6 extra flag chars): p | [reply] [d/l] [select] |
by MeowChow (Vicar) on Apr 25, 2001 at 22:10 UTC | |
61 chars of code plus 3 modifier chars. MeowChow s aamecha.s a..a\u$&owag.print | [reply] [d/l] |
by petral (Curate) on Apr 26, 2001 at 21:27 UTC | |
(I know, I know. I'm the only one who could possibly still be interested at this point.) * update "more interesting" meaning more <|triangular|>  (than the original challenge). And, moving even deeper into 'useless use of code in void context': will make triangles of files of any length (a step towards automated obfusification?). p | [reply] [d/l] [select] |