a few chars at a time, but there must be a better algorithm
#!perl -l *,=*ARGV;($,.=$,[$|])=~s,.,,,$,.=$,[$|--]x($&-1),$_.=$&while$,[2]>y|||c;print |
still too long, but a bit better
#!perl -l *;=*ARGV;$,.=$;[$|],$,=~s,.,,,$_.=$&,$,.=$;[$|--]x($&-1)while$;[2]>y|||c;print |
and another few chars off.
#!perl -l *;=*ARGV;@,=(@,,$;[$|]),$_.=$"=shift@,,push@,,($;[$|--])x--$"while y|||c<$;[2];print |
still *way* too long but worth submitting at this point
#!perl -l *;=*ARGV;@,=(@,,$;[$|]),$_.=$a=shift@,,push@,,($;[$|--])x--$a while y|||c<$;[2];print |
a bit more respectable of a solution, though still not good enough.
#!perl -l
@;=@ARGV;$_.=$;[$|]x(substr($_,$"++,1)||$;[$|]),$|--while y|||c<500;s/(.{$;[2]}).*/$1/;print
|
this is way too long for this. I ought to be able to reduce it a fair bit
#!perl -l @;=@ARGV;$"++,$_.=$;[$|]x$;[$|--]while y|||c<2;$_.=$;[$|--]x substr($_,$"++,1)while y|||c<500;substr($_,$;[2])=$,;print |