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

Re: [FWP] Re: Golf: chessboard



Ton Hospel wrote:
> 
> In article <20010304023104.57D18261BB@server3.safepages.com>,
>         "Keith Calvert Ivey" <kcivey@cpcug.org> writes:
> Ok, first attempt:
> 
> $_=pop;s/\d/$|x$&/eg;s/./--$|?$&||$":$&||"."/eg;y|/|\n|;print

Sorry Ton, that's out of bounds, quoting from the rules:
"there are spaces between the columns".

Cool use of a toggling variable, though.

Mine's down to 65 characters:

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

-- 
Rick Klement

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