Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Re: Triangle Golf

by petral (Curate)
on Apr 25, 2001 at 21:15 UTC ( #75542=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/local/bin/perl -ln0777
    
    ...
    
      print " " x (40 - ($c = 1 + length $1) / 2), $1
    }
    
  2. or download this
                                          a 
                                        a a a 
    ...
                          words only on spaces or new lines 
    
    
  3. or download this
    > perl -ln0777we '$c=0;s/\s+/ /sg;print" "x(40-($c=length$1)/2),$1 whi
    +le s/(.{$c,}?. |.+$)//' a.txt w.txt
                                           a 
                                          a a 
    ...
                                         lines 
    
    
  4. or download this
    > perl -ln0777e's/\s+/ /sg;print$"x(40-($c=length$&)/2),$&while s/.{0$
    +c,}?. |.+$//' a.txt w.txt
                                           a 
                                          a a 
    ...
                                    a a a a a a a a 
                                       a a a a a 
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2014-12-21 23:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (109 votes), past polls