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

Re: [FWP] Re: Golf: chessboard



Ton Hospel <fun_with_perl@ton.iguana.be> wrote:

> Ok, first attempt:
> 
> $_=pop;s/\d/$|x$&/eg;s/./--$|?$&||$":$&||"."/eg;y|/|\n|;print

I knew there was way to use $| for a toggle, but for some 
reason I couldn't figure it out last night.  That and filling 
the empty squares with 0s initially are the sort of creativity 
I was hoping for.

Unfortunately, you're missing the spaces between columns and 
(unless you're using -l) the newline at the end.

-- 
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC

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