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

Re: [FWP] Re: Golf: chessboard



Ton Hospel wrote:
> That's fixable at the price of extra spaces in front (64 chars):
> #!/usr/bin/perl -l
> $_=pop;s/\d/$|x$&/eg;s/./--$|||$&?" $&":" ."/eg;y|0/| \n|;print

My editor counts that as 63 characters.
If extra spaces are allowed in front, then I can make 61 characters:

#!/usr/bin/perl -l
$_=pop;s/\d/$"x$&/eg;s/ (?!(..)*$)/./g;y#/#\n#;s/()/ /g;print

with the aid of the rather weird s/()/ /g to put spaces between
every character.
-- 
Rick Klement

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