Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Re: ASCII Pattern - Golf

by tedrek (Pilgrim)
on Sep 19, 2003 at 02:22 UTC ( #292560=note: print w/replies, xml ) Need Help??


in reply to Re: ASCII Pattern - Golf
in thread ASCII Pattern - Golf

And getting rid of the for loops appears to take another 10 strokes off.
$x=shift;$z=10-shift;map{$t=abs$z-$_;print map($t>abs$x-$_?$t:abs$x-$_ +,1..9),$/;}0..9

Replies are listed 'Best First'.
Re: Re: Re: ASCII Pattern - Golf
by tilly (Archbishop) on Sep 19, 2003 at 02:43 UTC
    You can get 4 more with shift vs pop. + 1 for a useless ;.
    $z=10-pop;$x=pop;map{$t=abs$z-$_;print map($t>abs$x-$_?$t:abs$x-$_,1.. +9),$/}1..9
    (I also fixed a bug.)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://292560]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2021-09-24 10:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?